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