[Tutor] help with random.randint (cont. -- now: pseudo code)

David ldl08 at gmx.net
Wed Feb 3 10:06:09 CET 2010


brilliant stuff -- I am truly awed by this. Create a default-filled 
matrix and mark combinations used so as to take them out of the game? 
Wow. This is new to me.

On 03/02/10 15:46, bob gailer wrote

> def askQuestions(): # generate and ask questions:
> for i in range(NQ):
> while 1: # loop till we get an unused combo
> x, y = [random.randint(1,MAX) for i in 'ab']
> if mtable[x][y] == 1: # combo is available
> break
> askQuestion(x,y)
> # indicate asked
> mtable[x][y] = 0
> mtable[y][x] = 0

Here you lose me, though. Where does mtable come from, what does it do? 
You don't introduce it as a variable, and when I google it, nothing much 
comes of if...


More information about the Tutor mailing list