Loops/Nested: Difference between revisions
Content added Content deleted
(→{{header|Scheme}}: ++ sather) |
(→[[Loops/Nested#ALGOL 68]]: # http://xkcd.com/292/ #) |
||
Line 29: | Line 29: | ||
16 10 10 20 |
16 10 10 20 |
||
</pre> |
</pre> |
||
=={{header|ALGOL 68}}== |
|||
{{trans|C}} - note: This specimen retains the original C coding style. |
|||
{{works with|ALGOL 68|Standard - no extensions to language used}} |
|||
{{works with|ALGOL 68G|Any - tested with release [http://sourceforge.net/projects/algol68/files/algol68g/algol68g-1.18.0/algol68g-1.18.0-9h.tiny.el5.centos.fc11.i386.rpm/download 1.18.0-9h.tiny]}} |
|||
{{works with|ELLA ALGOL 68|Any (with appropriate job cards)}} |
|||
<lang algol68>main: ( |
|||
[10][10]INT a; INT i, j; |
|||
FOR i FROM LWB a TO UPB a DO |
|||
FOR j FROM LWB a[i] TO UPB a[i] DO |
|||
a[i][j] := ENTIER (random * 20 + 1) |
|||
OD |
|||
OD ; |
|||
FOR i FROM LWB a TO UPB a DO |
|||
FOR j FROM LWB a[i] TO UPB a[i] DO |
|||
print(whole(a[i][j], -3)); |
|||
IF a[i][j] = 20 THEN |
|||
GO TO xkcd com 292 # http://xkcd.com/292/ # |
|||
FI |
|||
OD; |
|||
print(new line) |
|||
OD; |
|||
xkcd com 292: |
|||
print(new line) |
|||
)</lang> |
|||
Sample output: |
|||
<pre> |
|||
8 14 17 6 18 1 1 7 9 6 |
|||
8 9 1 15 3 1 10 19 6 7 |
|||
12 20 |
|||
</pre> |
|||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |
||
<lang AutoHotkey>Loop, 10 |
<lang AutoHotkey>Loop, 10 |