annotate lab1/gcd.p @ 1:b5139af1a420 tip basis

Fixed permissions on compile scripts
author Mike Spivey <mike@cs.ox.ac.uk>
date Fri, 13 Oct 2017 17:27:58 +0100
parents bfdcc3820b32
children
rev   line source
0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
1 (* lab1/gcd.p *)
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
3 begin
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
4 x := 3 * 37; y := 5 * 37;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
5 while x <> y do
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
6 if x > y then
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
7 x := x - y
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
8 else
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
9 y := y - x
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
10 end
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
11 end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
12 print x; newline
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
13 end.
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
14
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
15 (*<<
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
16 37
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
17 >>*)