Show ASCII table: Difference between revisions

→‎{{header|ALGOL W}}: Simplify and show the table vertically, as most of the other samples do
(→‎{{header|ALGOL 68}}: (Very) Minor simplification)
(→‎{{header|ALGOL W}}: Simplify and show the table vertically, as most of the other samples do)
Line 473:
 
=={{header|ALGOL W}}==
This assumes the ASCII character set is used by the Algol W compiler/runtime - the original Algol W implementation used EBCDIC.
<syntaxhighlight lang="algolw">begin
<syntaxhighlight lang="algolw">% generate an ascii table for chars 32 - 127 %
for i := 32 until 32 + 15 do begin
integer cPos;
cPos := 0write();
for ic := 32i step 16 until 127i + ( 16 * 5 ) do begin
ifwriteon( cPosi_w := 3, s_w := 0, thenc, ": " write();
cPosif := ( cPos + 1 )c rem= 6; 32 then writeon( "Spc ")
writeon(else i_wif c := 3,127 s_wthen := 0, i,writeon( ":Del " );
ifelse i = 32 then writeon( code( c ), "Spc " )
end for_ifor_ach
else if i = 127 then writeon( "Del " )
end for_i.
else writeon( code( i ), " " )
</syntaxhighlight lang="algolw">begin
end for_i
end.</syntaxhighlight>
{{out}}
<pre>
<pre> 32: Spc 33: ! 34: " 35: # 36: $ 37: %
3832: &Spc 3948: '0 4064: (@ 4180: )P 4296: * ` 43112: +p
4433: ,! 4549: -1 4665: .A 4781: /Q 4897: 0a 49113: 1q
5034: 2" 5150: 32 5266: 4B 5382: 5R 5498: 6 b 55114: 7r
5635: 8# 5751: 93 5867: :C 5983: ;S 6099: < c 61115: =s
6236: >$ 6352: ?4 6468: @D 6584: AT 66100: B d 67116: Ct
6837: D% 6953: E5 7069: FE 7185: GU 72101: H e 73117: Iu
7438: J& 7554: K6 7670: LF 7786: MV 78102: N f 79118: Ov
8039: P' 8155: Q7 8271: RG 8387: SW 84103: T g 85119: Uw
8640: V( 8756: W8 8872: XH 8988: YX 90104: Z h 91120: [x
9241: \) 9357: ]9 9473: ^I 9589: _Y 96105: ` i 97121: ay
9842: b* 9958: c: 100 74: dJ 10190: eZ 102106: fj 103122: gz
104 43: h+ 105 59: i; 106 75: jK 107 91: k[ 108107: lk 109123: m{
110 44: n, 111 60: o< 112 76: pL 11392: q\ 114108: rl 115124: s|
116 45: t- 117 61: u= 118 77: vM 11993: w] 120109: xm 121125: y}
122 46: z. 123 62: {> 124 78: |N 125 94: }^ 126110: ~n 127126: Del</pre>~
<pre> 32 47: Spc/ 33 63: !? 3479: "O 3595: #_ 36111: $ o 37127: %Del
</pre>
 
=={{header|APL}}==
3,028

edits