comparison lab1/loop.p @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 (* lab1/loop.p *)
2
3 begin
4 x := 12345;
5 i := 1;
6 loop
7 print i; newline;
8 j := 2 * i;
9 if j > x then exit end;
10 i := j
11 end
12 end.
13
14 (*<<
15 1
16 2
17 4
18 8
19 16
20 32
21 64
22 128
23 256
24 512
25 1024
26 2048
27 4096
28 8192
29 >>*)