
-----------------------------------
MattMcDonald
Wed Apr 21, 2004 6:50 pm

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

-----------------------------------
Delos
Wed Apr 21, 2004 7:03 pm


-----------------------------------
First, read this:
[url=http://www.compsci.ca/v2/viewtopic.php?t=461]Basic quidelines

Then, consider using a secondary array to cross reference the numbers in your main array.

-----------------------------------
Tony
Wed Apr 21, 2004 7:21 pm


-----------------------------------
:? [url=http://www.compsci.ca/v2/viewtopic.php?t=2184]Unique Number List Generation
