Count in octal: Difference between revisions
Content added Content deleted
(I added Salmon code.) |
|||
Line 638: | Line 638: | ||
<lang Retro>octal |
<lang Retro>octal |
||
17777777777 [ putn cr ] iter</lang> |
17777777777 [ putn cr ] iter</lang> |
||
=={{header|Salmon}}== |
|||
Salmon has built-in unlimited-precision integer arithmetic, so these examples will all continue printing octal values indefinitely, limited only by the amount of memory available (it requires O(log(n)) bits to store an integer n, so if your computer has 1 GB of memory, it will count to a number with on the order of <math>2^{80}</math> octal digits). |
|||
<lang Salmon>iterate (i; [0...+oo]) |
|||
printf("%o%\n", i);;</lang> |
|||
or |
|||
<lang Salmon>for (i; 0; true) |
|||
printf("%o%\n", i);;</lang> |
|||
or |
|||
<lang Salmon>variable i := 0; |
|||
while (true) |
|||
{ |
|||
printf("%o%\n", i); |
|||
++i; |
|||
};</lang> |
|||
=={{header|Scala}}== |
=={{header|Scala}}== |