1.1 --- a/examples/simple2.py Sat Sep 15 23:47:05 2007 +0000
1.2 +++ b/examples/simple2.py Sat Sep 15 23:48:26 2007 +0000
1.3 @@ -5,6 +5,7 @@
1.4 """
1.5
1.6 import time
1.7 +#import random
1.8
1.9 # Array size.
1.10
1.11 @@ -19,8 +20,9 @@
1.12 A supposedly time-consuming calculation on 'i' and 'j'.
1.13 """
1.14
1.15 + #time.sleep(delay * random.random())
1.16 time.sleep(delay)
1.17 - return i * N + j
1.18 + return (i, j, i * N + j)
1.19
1.20 # Main program.
1.21
1.22 @@ -37,7 +39,8 @@
1.23 print "Calculating..."
1.24 for i in range(0, N):
1.25 for j in range(0, N):
1.26 - results[i*N+j] = calculate(i, j)
1.27 + i2, j2, result = calculate(i, j)
1.28 + results[i2*N+j2] = result
1.29
1.30 # Show the results.
1.31