What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » random number generater help

random number generater help
Author: Message:
Phrive
Full Member
***

Avatar
...!Phrive!...

Posts: 401
Reputation: 4
35 / Male / –
Joined: May 2004
O.P. random number generater help
i want to make a random number generator for just one number between 1 and 10 i am using c++ i used a code but i coudnt get it to work i had a time error or semething i know its real baisc any one got any help?

[edit] plz its well important its gonna be my first project and i need to have som ebasic to get me into, it for use at school and things to show ppl i can do it[/edit]

This post was edited on 07-23-2004 at 10:02 AM by Phrive.
[Image: 1thing5hk.gif]

07-23-2004 09:09 AM
Profile E-Mail PM Find Quote Report
.blade//
Veteran Member
*****

Avatar

Posts: 2856
Reputation: 39
36 / Male / –
Joined: Jan 2004
RE: random number generater help
quote:
Originally posted by _-PhRiVe-_
i want to make a random number generator for just one number between 1 and 10 i am using c++ i used a code but i coudnt get it to work i had a time error or semething i know its real baisc any one got any help?

[edit] plz its well important its gonna be my first project and i need to have som ebasic to get me into, it for use at school and things to show ppl i can do it[/edit]


http://www.experts-exchange.com/ is where I get all my coding help, they are very good (to ask a question or view an answer to someone else's question you do need to make a [free] account, though).
[Image: A%20Pointy%20Rock.jpg]
07-24-2004 12:43 AM
Profile PM Web Find Quote Report
Maniac
Senior Member
****

Avatar
Posts including T&T: 1684

Posts: 549
Reputation: 9
37 / Male / –
Joined: Apr 2004
RE: random number generater help
Interesting how no one answered my thread when I asked for help...

Anyways, that shouldnt bee too complicated...

there's a default random function I think.... i'm guessing you could do:

int i = random(10);

unless there isn't a random function and you'd just have to get a library that uses it
[Image: maniacsig0pb.jpg]
*It took Jesus 3 days to respawn! Talk about lag!* :rofl:
07-24-2004 01:25 AM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: random number generater help
There is a random function, but you don't use it like that.

Try
code:
rand() % 10 + 1
the % performs a modulo division, yielding a number from 0-9. This is offset to get a number from 1-10.
[Image: spartaafk.png]
07-24-2004 09:23 AM
Profile PM Web Find Quote Report
Maniac
Senior Member
****

Avatar
Posts including T&T: 1684

Posts: 549
Reputation: 9
37 / Male / –
Joined: Apr 2004
RE: random number generater help
yeah true.... i'm bad at comming out with code just out of the top of my head.... i tend to need to actually do it! :p

Anyways, where can we find tutorials for basic stuff? (yes i made a whole new thread for this but NO ONE answered.... :dodgy: )
[Image: maniacsig0pb.jpg]
*It took Jesus 3 days to respawn! Talk about lag!* :rofl:
07-24-2004 12:59 PM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: random number generater help
For VB and VC++, use MSDN, or Google for some.
[Image: spartaafk.png]
07-24-2004 01:10 PM
Profile PM Web Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
32 / Male / Flag
Joined: Mar 2003
Status: Online
RE: random number generater help
Try : http://www.pscode.com
YouTube closed-captions ripper (also allows you to download videos!)
07-24-2004 03:55 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On