View source for Module:Shared
From Melvor Idle
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
local Num = require('Module:Number')
--So there are a handful of functions that I'm using in a lot of places
--So rather than continue to copy across the same handful of functions to every single new module
--I'm just going to unify them here
--Here's how you use this:
-- 1. When you're making a new module, add this near the top:
-- local Shared = require( "Module:Shared" )
-- 2. When you need to make a call to one of these functions,
-- just preface it with "Shared."
-- So for example you could call tableCount like so:
-- Shared.tableCount(data)
--This whole module copied wholesale from the Warframe wiki (https://warframe.fandom.com/wiki/Module:Shared)
--I removed a couple irrelevant functions, but otherwise did not change anything
local p = {}
-- iterator sorted by keys
-- For example, if you had a table that looked something like
-- data = {["Cat"] = 5,
-- ["Bat"] = 4,
000
1:0
Template used on this page:
Return to Module:Shared.