Card Program
Author |
Message |
upthescale
|
Posted: 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? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
HellblazerX
|
Posted: Mon May 29, 2006 8:50 pm Post subject: (No subject) |
|
|
Just use Rand.Int.
code: | put suits (Rand.Int (1,4)) |
|
|
|
|
|
|
Clayton
|
Posted: Mon May 29, 2006 9:09 pm Post subject: (No 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 |
|
|
|
|
|
upthescale
|
Posted: Mon May 29, 2006 9:26 pm Post subject: (No 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 |
|
|
|
|
|
Clayton
|
Posted: Mon May 29, 2006 9:31 pm Post subject: (No subject) |
|
|
u know how to use randint, and Rand.Int, just take what you know and expand |
|
|
|
|
|
|
|