A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
25
Task/Multiplication-tables/MOO/multiplication-tables-1.moo
Normal file
25
Task/Multiplication-tables/MOO/multiplication-tables-1.moo
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
@verb me:@tables none none none rxd
|
||||
@program me:@tables
|
||||
player:tell(" | 1 2 3 4 5 6 7 8 9 10 11 12");
|
||||
player:tell("-------------------------------------------------------------------");
|
||||
for i in [1..12]
|
||||
line = ((i < 10) ? " " | " ") + tostr(i) + " | ";
|
||||
for j in [1..12]
|
||||
if (j >= i)
|
||||
product = i * j;
|
||||
"calculate spacing for right justification of values";
|
||||
if (product >= 100)
|
||||
spacer = "";
|
||||
elseif (product >= 10)
|
||||
spacer = " ";
|
||||
else
|
||||
spacer = " ";
|
||||
endif
|
||||
line = line + " " + spacer + tostr(product);
|
||||
else
|
||||
line = line + " ";
|
||||
endif
|
||||
endfor
|
||||
player:tell(line);
|
||||
endfor
|
||||
.
|
||||
11
Task/Multiplication-tables/MOO/multiplication-tables-2.moo
Normal file
11
Task/Multiplication-tables/MOO/multiplication-tables-2.moo
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
@program me:@tables
|
||||
player:tell(" | 1 2 3 4 5 6 7 8 9 10 11 12");
|
||||
player:tell($string_utils:space(67, "-"));
|
||||
for i in [1..12]
|
||||
line = " " + $string_utils:right(i, 2) + " | ";
|
||||
for j in [1..12]
|
||||
line = line + " " + ((i > j) ? " " | $string_utils:right(j*i, 3));
|
||||
endfor
|
||||
player:tell(line);
|
||||
endfor
|
||||
.
|
||||
Loading…
Add table
Add a link
Reference in a new issue