comparison lab1/case.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/case.p *)
2
3 begin
4 i := 0;
5 while i < 10 do
6 case i of
7 1, 3, 5:
8 i := i + 1;
9 i := i + 2
10 | 2, 6:
11 i := i - 1;
12 | 8:
13 i := i + 2;
14 else
15 i := i + 1
16 end;
17 print i; newline
18 end
19 end.
20
21 (*<<
22 1
23 4
24 5
25 8
26 10
27 >>*)