Execute Brain****/ALGOL 68: Difference between revisions
m
Fixed syntax highlighting.
m (RCBF (ALGOL 68) moved to RCBF/ALGOL 68: MW has page hierarchy support. (Who'da thunk it?)) |
m (Fixed syntax highlighting.) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1:
{{implementation|Brainf***}}{{collection|RCBF}}
An implementation of BF in [[ALGOL 68]] for Rosetta Code.
MODE CADDR = BYTE; # code address #
Line 32:
# [ # VOID:
IF data list[data addr] = zero THEN
INT br
IF code list[code addr] = ABS "["
THEN
br level +:= 1;
ELIF code list[code addr] = ABS "]"
THEN
br level -:= 1
FI;
IF br level > 0
THEN
code addr +:= 1;
TRUE
ELSE
FALSE
FI
DO SKIP OD
FI,
# ] # VOID:
IF data list[data addr] /= zero THEN
INT br
IF code list[code addr] = ABS "["
THEN
br level +:= 1
ELIF code list[code addr] = ABS "]"
THEN
br level -:= 1
FI;
code addr -:= 1;
br level < 0
DO SKIP OD
FI
Line 60 ⟶ 83:
FOR i TO UPB code list DO byte code list[i] := ABS code list[i] OD;
run(byte code list)</syntaxhighlight>
|