cwtests/cw02/loops.while
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 03 Dec 2021 18:00:30 +0000
changeset 854 ce4a7bab6bd8
parent 833 aad5957eb7e4
permissions -rw-r--r--
testcases
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
833
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     1
start := 1000; 
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     2
x := start;
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     3
y := start;
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     4
z := start;
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     5
while 0 < x do {
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     6
 while 0 < y do {
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     7
  while 0 < z do { z := z - 1 };
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     8
  z := start;
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     9
  y := y - 1
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    10
 };     
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    11
 y := start;
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    12
 x := x - 1
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    13
}
aad5957eb7e4 cwupdates
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    14