Anonymous user
Smallest numbers: Difference between revisions
m
→{{header|REXX}}: simplified the code.
m (→{{header|REXX}}: simplified the code.) |
|||
Line 688:
if cols=='' | cols=="," then cols= 10 /* " " " " " " */
w= 6 /*width of a number in any column. */
say ' N │'center(
say '─────┼'center(""
$=; idx= 0 /*define $ output list; index to 0.*/
do j=0 for hi
do k=1 until pos(j, k**k)>0 /*calculate a bunch of powers (K**K). */
end /*k*/
c= commas(k) /*maybe add commas to the powe of six. */
$= $ right(c, max(w, length(c) ) ) /*add a K (power) ──► list, allow big#*/
if
say center(idx, 5)'│'substr($, 2); $= /*display what we have so far (cols). */
idx= idx + cols /*bump the index count for the output*/
Line 703:
if $\=='' then say center(idx, 5)"│"substr($,2) /*possible display any residual output.*/
say '─────┴'center(""
exit 0 /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
|