Category:ALGOL 68: Difference between revisions

→‎Coding style of samples: no need to show upper stropping twice
(→‎TODO: Changed heading)
(→‎Coding style of samples: no need to show upper stropping twice)
Line 114:
Rutgers ALGOL 68 uses quote stropping. Most of the samples
on Rosetta Code use Upper stropping.
Examples (pragmatic comments to set the stropping regime not shown):
Example:
{|border="1" style="border-collapse: collapse; border: 5px2px double grey;" align="centerleft"
|| Algol68 as typically published
¢ bold/underline typeface ¢
'''mode''' '''xint''' = '''int''';
'''xint''' sum sq:=0;
Line 125 ⟶ 124:
sum sq+:=i↑2
'''od'''
|| quoteQUOTE stropping (similar to wiki)
'pr' quote 'pr'
'mode' 'xint' = 'int';
'xint' sum sq:=0;
Line 134 ⟶ 132:
sum sq+:=i↑2
'od'
|| POINT stropping
|| 7-bit/ascii compiler
.PR UPPER .PR
MODE XINT = INT;
XINT sum sq:=0;
FOR i WHILE
sum sq/=70*70
DO
sum sq+:=i**2
OD
|| 6-bits/byte compiler
.PR POINT .PR
.MODE .XINT = .INT;
.XINT SUM SQ:=0;
Line 153 ⟶ 141:
.OD
|| RES stropping
.PR RES .PR
mode .xint = int;
.xint sum sq:=0;
Line 162 ⟶ 149:
od
|| Upper stropping
# upper case = bold #
MODE XINT = INT;
XINT sum sq:=0;
3,044

edits