annotate lab2/array.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
mike@0 1 (* lab2/array.p *)
mike@0 2
mike@0 3 var a: array 10 of integer;
mike@0 4 var i: integer;
mike@0 5
mike@0 6 begin
mike@0 7 i := 2; a[0] := 1; a[1] := 1;
mike@0 8 while i < 10 do
mike@0 9 a[i] := a[i-2] + a[i-1];
mike@0 10 i := i+1
mike@0 11 end;
mike@0 12 i := 0;
mike@0 13 while i < 10 do
mike@0 14 print a[i]; newline;
mike@0 15 i := i+1;
mike@0 16 end
mike@0 17 end.
mike@0 18
mike@0 19 (*<<
mike@0 20 1
mike@0 21 1
mike@0 22 2
mike@0 23 3
mike@0 24 5
mike@0 25 8
mike@0 26 13
mike@0 27 21
mike@0 28 34
mike@0 29 55
mike@0 30 >>*)