Template:ClassMatrix: Difference between revisions

No edit summary
No edit summary
Line 1: Line 1:
{{#def:ALL|{{#SearchTitle:{{{1}}} }}}}
{{#def:ALL|{{#SearchTitle:{{{1}}} }}}}


{{#lua:
{{#def:X-AXIS|{{#lua:
   local H = {};
   local H = {};
   local T = {};
   local T = {};
Line 14: Line 14:
   for i=1,table.getn(T) do
   for i=1,table.getn(T) do
     local k = T[i];
     local k = T[i];
     print(k .. H[k]);
     print(k .. " " .. H[k]);
   end
   end
|{{#var:ALL}}
|{{#var:ALL}}
}}
}}
}}
{{#def:Y-AXIS|{{#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
|{{#var:ALL}}
}}
}}
{{#var:X-AXIS}}
{{#var:Y-AXIS}}

Revision as of 03:09, 18 December 2008




{{#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

| }}