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

Username:   Password: 
 RegisterRegister   
 Random integer
Index -> Programming, C++ -> C++ Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Chris




PostPosted: Wed Mar 01, 2006 6:58 pm   Post subject: Random integer

I need to know how to create a random integer of 1,2, or 3. Thanks in advance for the help
Sponsor
Sponsor
Sponsor
sponsor
md




PostPosted: Wed Mar 01, 2006 6:59 pm   Post subject: (No subject)

google rand, srand, and modulus. Together those will solve your random number needs.
Chris




PostPosted: Wed Mar 01, 2006 7:02 pm   Post subject: (No subject)

Cornflake wrote:
google rand, srand, and modulus. Together those will solve your random number needs.
could you just give me the awnser instead of saying "look it up"?
[Gandalf]




PostPosted: Wed Mar 01, 2006 7:25 pm   Post subject: (No subject)

I guess not... But there is an alternative! You could use the search button and find the answer for yourself, since I know it's already there.
md




PostPosted: Thu Mar 02, 2006 12:40 am   Post subject: (No subject)

c++:

srand(SOME_RANDOM_SEED);
int k = (rand() % (HIGH-LOW))+LOW;


There, happy? If I give you the code how does it help you learn though?
wtd




PostPosted: Thu Mar 02, 2006 12:44 am   Post subject: (No subject)

Silly, silly cornflake... everyone knows you're only learning when you get high grades. If he gets a high gradfe because of that, then he must have learned something from it.
md




PostPosted: Thu Mar 02, 2006 1:12 am   Post subject: (No subject)

Oh, of course! How silly of me! Because we all know that grades are the end all be all, and that doing supremely well in high school is the most important thing ever! Wink
rizzix




PostPosted: Thu Mar 02, 2006 1:56 pm   Post subject: (No subject)

we do? Confused
Sponsor
Sponsor
Sponsor
sponsor
bugzpodder




PostPosted: Thu Mar 02, 2006 2:11 pm   Post subject: (No subject)

Cornflake wrote:
Oh, of course! How silly of me! Because we all know that grades are the end all be all, and that doing supremely well in high school is the most important thing ever! Wink


silly silly Cornflake... do I need to remind you of our CS134 project?
md




PostPosted: Thu Mar 02, 2006 6:40 pm   Post subject: (No subject)

The which wha who? IIRC I only worked on one project with others...
MysticVegeta




PostPosted: Thu Mar 02, 2006 6:53 pm   Post subject: (No subject)

bugzpodder wrote:
Cornflake wrote:
Oh, of course! How silly of me! Because we all know that grades are the end all be all, and that doing supremely well in high school is the most important thing ever! Wink


silly silly Cornflake... do I need to remind you of our CS134 project?

LOL
Justin_




PostPosted: Thu Mar 02, 2006 11:30 pm   Post subject: (No subject)

Photoshop is a very intimidating application; I'd die at an early age if I had to program it. But, I'm sure i'll get better at making sigs.
[Gandalf]




PostPosted: Thu Mar 02, 2006 11:49 pm   Post subject: (No subject)

Although I would have to agree... What..?

This is your second strangely off-topic post, you sure everything is... ok?
Justin_




PostPosted: Fri Mar 03, 2006 12:04 am   Post subject: (No subject)

I needed to see my new siggy in action so I targeted a B.S. thread to say my B.S.
[Gandalf]




PostPosted: Fri Mar 03, 2006 12:20 am   Post subject: (No subject)

Ah. Good reason. Although you could have just previewed your post, and not posted it.

In that case, you may be interested to know that we do not see your signature, we see:
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 24 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: