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

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




PostPosted: Fri Jan 23, 2004 3:26 pm   Post subject: dice help

i want to be ablt to roll a dice and save the first # then roll again and quit if its the same, how would i do that?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Jan 23, 2004 3:28 pm   Post subject: (No subject)

code:

if Rand.Int(1,6) = Rand.Int(1,6) then
put "rolled the same number twice"
quit
end if
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Cervantes




PostPosted: Fri Jan 23, 2004 3:31 pm   Post subject: (No subject)

hehe or

code:
if Rand.Int (1,36) = 1 then
   put "rolled the same number twice"
   quit
end if


Cheers
Tony




PostPosted: Fri Jan 23, 2004 3:33 pm   Post subject: (No subject)

no.... Confused

Cervantes - first number can be anything, then you have 1/6 chance to roll the same... so:
code:

if Rand.Int (1,6) = 1 then
   put "rolled the same number twice"
   quit
end if
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Cervantes




PostPosted: Fri Jan 23, 2004 4:15 pm   Post subject: (No subject)

nooooo!!! I have been discovered!! blast you tony!! Razz
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  [ 5 Posts ]
Jump to:   


Style:  
Search: