Functions as values (no closures yet, and no tests)

This commit is contained in:
Dmitry Boulytchev 2019-09-22 20:15:15 +03:00
parent f5b802ebed
commit d69cb3d49d
12 changed files with 194 additions and 160 deletions

View file

@ -1,4 +1,4 @@
global n, c, p, cc, q, i, m, d;
global n, c, p, q, i, m, d;
n := read ();
@ -7,7 +7,7 @@ p := 2;
while c do
cc := 1;
local cc = 1;
while cc do
q := 2;
@ -17,8 +17,7 @@ while c do
q := q + 1
od;
if cc then cc := 0 else p := p + 1; cc := 1 fi
if cc then cc := 0 else p := p + 1; cc := 1 fi
od;
d := p;