Jump to content

Show ASCII table: Difference between revisions

→‎{{header|ALGOL 68}}: (Very) Minor simplification
(→‎{{header|ALGOL 68}}: Show the table vertically as with most of the other samples)
(→‎{{header|ALGOL 68}}: (Very) Minor simplification)
Line 438:
=={{header|ALGOL 68}}==
<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 cach FROM 32c BY 16 TO 32c + 15( 16 * 5 ) DO
FORprint( ach FROM c BY 16 TO c +( whole( 16ach, * 5-4 ) DO
print( ( whole( ach, -4": )"
, IF ,ach ":= 32 THEN "SPC"
, IF ELIF ach = 32127 THEN "SPCDEL"
ELSE " " + ELIFREPR ach = 127 THEN+ "DEL "
ELSE " " + REPR ach + " "FI
FI
)
)
OD;
print( ( newline ) )
OD
END
</syntaxhighlight>
{{out}}
3,044

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.