Nimber arithmetic: Difference between revisions

Content added Content deleted
m (→‎{{header|Raku}}: Refactor to set table size with a parameter)
m (→‎{{header|Raku}}: Minor style twiddles)
Line 706: Line 706:
my $upto = 26;
my $upto = 26;


for '', &infix:<⊕>,
for <>, &infix:<⊕>,
'', &infix:<⊗>
<>, &infix:<⊗>
-> $op, &f {
-> $op, &f {
print "\n\n\n $op | ", (^$upto)».fmt('%3s'), "\n", '---+-', '----' x $upto;
print "\n $op | ", (^$upto)».fmt('%3s'), "\n", '---+-', '----' x $upto;


^$upto .map: -> $r {
^$upto .map: -> $r {
Line 715: Line 715:
print &f($r, $_).fmt('%4s') for ^$upto;
print &f($r, $_).fmt('%4s') for ^$upto;
}
}
put "\n\n";
}
}

put "\n\n";


put "21508 ⊕ 42689 = ", 21508 ⊕ 42689;
put "21508 ⊕ 42689 = ", 21508 ⊕ 42689;