Template:Enzyme/Uniq

From Metabolomics.JP
< Template:Enzyme(Difference between revisions)
Jump to: navigation, search
(New page: {{#lua: seen = {}; S = {}; for str in stdin:gmatch("([%w]+)") do if not seen[str] then table.insert(S); seen[str] = true; end end print( table.concat(S, " + ") ); |{{{1}}}}})
 
Line 2: Line 2:
 
   seen = {}; S = {};
 
   seen = {}; S = {};
 
   for str in stdin:gmatch("([%w]+)")
 
   for str in stdin:gmatch("([%w]+)")
     do if not seen[str] then table.insert(S); seen[str] = true; end
+
     do if not seen[str] then table.insert(S, str); seen[str] = true; end
 
     end
 
     end
 
   print( table.concat(S, " + ") );
 
   print( table.concat(S, " + ") );
 
|{{{1}}}}}
 
|{{{1}}}}}

Revision as of 14:35, 24 January 2009

1

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox