Template:ClassMatrix

Revision as of 07:35, 18 December 2008 by Editor (talk | contribs)




{{#lua:

 local input = stdin:match(".+");
 xaxis, yaxis, all = string.gmatch(input, "(.+)&&(.+)&&(.+)");
 print (input);

|&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%w+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%w+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }} }}


{{#lua:}}! ({{{1}}} () {{{1}}} () for (id in stdin:gmatch("%w+") do) {{{1}}} () {{{1}}} () {{{1}}} () {{{1}}} () end () end () table.sort(T); () {{{1}}} () {{{1}}} () print(k (.. " " .. H[k]);) end () () ())