progs/loops.while
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Mon, 11 Nov 2013 00:34:14 +0000
changeset 182 9ce2414e470e
parent 148 36eb7bfb0e63
child 207 f824e1331fc6
permissions -rw-r--r--
added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
182
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
     1
start := 1000;   // start value
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
x := start;
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
y := start;
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
z := start;
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
while 0 < x do {
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
 while 0 < y do {
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
     7
  while 0 < z do { z := z - 1 };
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
  z := start;
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
  y := y - 1
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
 };     
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
 y := start;
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
 x := x - 1
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
};
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    14