Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MattMcDonald




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Wed Apr 21, 2004 7:03 pm   Post subject: (No subject)

First, read this:
Basic quidelines

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




PostPosted: Wed Apr 21, 2004 7:21 pm   Post subject: (No subject)

Confused Unique Number List Generation
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: