Module:Weights

local p = {}

function p.gamemode( frame ) local modes = mw.loadData( 'Module:Gamemodes/data' ) local total = modes['total likelihood'] assert( frame.args[1], "Must specify a game mode" ) local mode = modes['modes'][frame.args[1]] or nil if not mode or mode['likelihood'] == 0 then return "0" end

local ours = mode['likelihood'] return string.format( "%d (%.2f%%)", ours, (ours / total) * 100 ) end

return p