Hi Neo,
Yes, I've read the rules. This isn't a homework, just brainteaser we're trying to work out. We're so poor in computer & programming, that's why we put this on programming forum, and our company isn't in computer business.
Someone has made a program in python like below, but it was for numbers 1 to 80 inside each table. We don't know how to modify the program if inside each table only numbers 1 to 20 like file New.xls above.
import random
group = [[]*10 for i in range(0,8)]
#-----------------------------------------
group[0] = [1,5,9,13,17,21,25,29,33,37]
group[1] = [41,45,49,53,57,61,65,69,73,77]
#-----------------------------------------
group[2] = [2,6,10,14,18,22,26,30,34,38]
group[3] = [42,46,50,54,58,62,66,70,74,78]
group[4] = [3,7,11,15,19,23,27,31,35,39]
group[5] = [43,47,51,55,59,63,67,71,75,79]
group[6] = [4,8,12,16,20,24,28,32,36,40]
group[7] = [44,48,52,56,60,64,68,72,76,80]
#-----------------------------------------
row = [0]*10
temp =[0]*10
for i in range(0,10):
row = []
temp = []
for i in range(0,8):
place = 0
for j in range(0,10):
place = random.randint(place,j)
temp[place] = temp[place][:]+[group[j]]
white = 0
place = 9
print temp
for j in range(0,10):
if len(temp[place]) == 0:
white = white +1
else:
newrow =random.randint(place,place+white)
temp[newrow] = temp[place]
if newrow != place:
temp[place] = []
white = newrow -place
place = place -1
print temp
for j in range(0,10):
if len(temp[j]) != 0:
row[j] = row[j][:] +temp[j][:]
temp[j] = []
for i in range(0,10):
print row
Thx.