Sandbox4
From Metabolomics.JP
(Difference between revisions)
m |
|||
Line 1: | Line 1: | ||
− | {{#def: | + | {{#def:stat| |
− | + | ||
{{#lua: | {{#lua: | ||
local T = {} | local T = {} | ||
Line 9: | Line 8: | ||
for k,v in pairs(T) do | for k,v in pairs(T) do | ||
total = total + v | total = total + v | ||
− | print(k.." | + | print(k.." "..v) |
+ | end | ||
+ | print(total) | ||
+ | |{{#SearchLine:FL63|Reference}} }} | ||
+ | }} | ||
+ | |||
+ | {{#lua: | ||
+ | local T = {} | ||
+ | for family, num in stdin:gmatch("([%a]+) ([%d]+)") do | ||
+ | if (T[family] == null) then T[family] = num else T[family] = T[family] + num end | ||
+ | end | ||
+ | total = 0 | ||
+ | for k,v in pairs(T) do | ||
+ | total = total + v | ||
+ | print(k.." "..v) | ||
end | end | ||
print(total) | print(total) | ||
− | |{{#var: | + | | {{#repeat:Stats/Family/GetFamilyName|1|{{#var:stat}} }} |
+ | }} |
Revision as of 04:17, 10 December 2009