Computer Science Canada

Card Program

Author:  upthescale [ Mon May 29, 2006 8:41 pm ]
Post subject:  Card Program

I would like to randomize 4 suits in cards:

code:

var suits : array 1 .. 4 of string := init ("Spades", "Diamonds", "Clubs", "Hearts")
for i : 1 .. 1
    put suits (i)
end for


it will put spades evertime, how cna i randomize the 4 suits?

Author:  HellblazerX [ Mon May 29, 2006 8:50 pm ]
Post subject: 

Just use Rand.Int.
code:
put suits (Rand.Int (1,4))

Author:  Clayton [ Mon May 29, 2006 9:09 pm ]
Post subject: 

upthescale, you are more than capable of doing the solution to your problem, plz dont post questions until you have thouroughly(sp?) thought the question through first, then post if you are still having problems

Author:  upthescale [ Mon May 29, 2006 9:26 pm ]
Post subject: 

hey, i did try fer about 120 minutes cept i was doing

randint ferst, it wudnt werk, but i had to use Rand.Int isntead

Author:  Clayton [ Mon May 29, 2006 9:31 pm ]
Post subject: 

u know how to use randint, and Rand.Int, just take what you know and expand


: