Show ASCII table: Difference between revisions

Content added Content deleted
(→‎{{header|ALGOL 68}}: Show the table vertically as with most of the other samples)
(→‎{{header|ALGOL 68}}: (Very) Minor simplification)
Line 438: Line 438:
=={{header|ALGOL 68}}==
=={{header|ALGOL 68}}==
<syntaxhighlight lang="algol68">
<syntaxhighlight lang="algol68">
# generate an ascii table for characters 32 - 127 #
BEGIN
FOR c FROM 32 TO 32 + 15 DO
# generate an ascii table for characters 32 - 127 #
FOR c FROM 32 TO 32 + 15 DO
FOR ach FROM c BY 16 TO c + ( 16 * 5 ) DO
FOR ach FROM c BY 16 TO c + ( 16 * 5 ) DO
print( ( whole( ach, -4 )
print( ( whole( ach, -4 )
, ": "
, ": "
, IF ach = 32 THEN "SPC"
, IF ach = 32 THEN "SPC"
ELIF ach = 127 THEN "DEL"
ELIF ach = 127 THEN "DEL"
ELSE " " + REPR ach + " "
ELSE " " + REPR ach + " "
FI
FI
)
)
)
)
OD;
OD;
print( ( newline ) )
print( ( newline ) )
OD
OD
END
</syntaxhighlight>
</syntaxhighlight>
{{out}}
{{out}}