# t09 in C4B figure 8 def f(): var i, j, x, r i = 1 j = 0 while j < x: j = j + 1 if i >= 10: i = 1 tick 40 else: r = unif(1,3) i = i + r tick 1