Module:Leveltype

local p = {}

local _lookupTable = 'Module:Leveltype/List'

local moves = 'Moves' local jelly = 'Jelly' local ingredients = 'Ingredients' local timed = 'Timed' local order = 'Order' local mixed = 'Mixed'

local function _lookupHexagonStatus( levelName ) if levelName and not (levelName == '') then -- Load data corresponding to level number and world local level = levelName:match('^Level (%d+)') if level then local data = mw.loadData( _lookupTable ) -- Get hexagon status for the level ('Hexagon, 'Super Hard', or '') return data[tonumber(level)] end end return false end

function p.leveltype local leveltype = _lookupHexagonStatus(mw.title.getCurrentTitle.text) local text = '' if leveltype then if leveltype == moves then text = "Moves" elseif leveltype == jelly then text = "Jelly" elseif leveltype == ingredients then text = "Ingredients" elseif leveltype == timed then text = "Timed" elseif leveltype == order then text = "Candy Order" elseif leveltype == mixed then text = "Mixed" end end return text end

return p