Computer Science Canada

dice help

Author:  jedi-bob [ 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?

Author:  Tony [ Fri Jan 23, 2004 3:28 pm ]
Post subject: 

code:

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

Author:  Cervantes [ Fri Jan 23, 2004 3:31 pm ]
Post subject: 

hehe or

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


Cheers

Author:  Tony [ Fri Jan 23, 2004 3:33 pm ]
Post 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

Author:  Cervantes [ Fri Jan 23, 2004 4:15 pm ]
Post subject: 

nooooo!!! I have been discovered!! blast you tony!! Razz


: