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

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




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




PostPosted: Mon May 29, 2006 8:50 pm   Post subject: (No subject)

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




PostPosted: 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




PostPosted: 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




PostPosted: 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
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: