Computer Science Canada

Help

Author:  MattMcDonald [ Wed Apr 21, 2004 6:50 pm ]
Post subject:  Help

I have a procedure to randomly generate 6 numbers and output them to the screen this is the code

procedure lottoRandomNumbers (var lottoRanNumbers : array 1 .. 6 of int)
for x : 1 .. 6
randint (lottoRanNumbers (x), 1, 49)
put lottoRanNumbers (x)
end for
end lottoRandomNumbers

var lottoRanNumbers : array 1 .. 6 of int

lottoRandomNumbers (lottoRanNumbers)

put i cant have the numbers repeat themeselves how do i do that

Author:  Delos [ Wed Apr 21, 2004 7:03 pm ]
Post subject: 

First, read this:
Basic quidelines

Then, consider using a secondary array to cross reference the numbers in your main array.

Author:  Tony [ Wed Apr 21, 2004 7:21 pm ]
Post subject: 

Confused Unique Number List Generation


: