Anonymous user
Nimber arithmetic: Difference between revisions
m
→{{header|REXX}}: simplified some code.
m (→{{header|REXX}}: simplified some code.) |
m (→{{header|REXX}}: simplified some code.) |
||
Line 1,537:
if bb=='' | bb=="," then bb= 42689 /* " " " " " " */
w= max(4,length(sz)); @.= '+'; @.1= "*"; _= '═' /*calculate the width of the table cols*/
!=
do am=0 for 2 /*perform sums, then perform multiplies*/
call top ! || center("("@.am')',
do k=0 for sz1 /*build a row of table. */
if am then $= $ || right( nprod(j, k), w) /*append to a table row.*/
else $= $ || right( nsum(j, k), w) /* " " " " " */
end /*k*/
say $
end /*j*/
call bot
Line 1,555 ⟶ 1,554:
exit 0 /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
hdr: $= ?
top: $= '╔'copies(_, w1)"╦"copies(copies(_, w), sz1)_; say $'╗'; arg ?; call hdr; return
sep: $= '╠'copies(_, w1)"╬"copies(copies(_, w), sz1)_; say $'╣'; return
|