Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / rnd(99) + 1 problem (dbpro)

Author
Message
Murder of ravens
20
Years of Service
User Offline
Joined: 17th Jul 2004
Location:
Posted: 12th Nov 2004 03:57
Hey i recently made a guess the random number game (see code) however the number although it should be random always turns out to be 42 (try it) can someone tell me why or if its just my computer. Thanks
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 12th Nov 2004 04:09
put randomize timer at the begining to fix that


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Murder of ravens
20
Years of Service
User Offline
Joined: 17th Jul 2004
Location:
Posted: 12th Nov 2004 04:16
ty, my friend suggested that as well but it didnt work i just get a variable error. "Variable 'timer' name is not valid at line 1." How do i declair the timer variable?
Murder of ravens
20
Years of Service
User Offline
Joined: 17th Jul 2004
Location:
Posted: 12th Nov 2004 04:18
ahh im really sorry, i forgot the () , hehe ty again oneka
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 12th Nov 2004 04:47
Gotta love that name.

You'll see why.
Murder of ravens
20
Years of Service
User Offline
Joined: 17th Jul 2004
Location:
Posted: 12th Nov 2004 04:54
my name? cant wait to see why
FoxBlitzz
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location: United States
Posted: 12th Nov 2004 05:25 Edited at: 12th Nov 2004 05:25
Quote: "my name? cant wait to see why"


Raven is a user on this board. You'll meet him soon enough.

Anyways, yes, you must randomize the timer because the way the random system works is that it uses a random seed. A random seed is a way to ensure you always get the same random numbers. However, if you set the random seed to the system time, it will always generate different numbers each time you run the program.

HP Pavilion | Intel Pentium 4 CPU 2.40 GHz
512 MB Ram | NVIDIA GeForceFX 5600 AGP, with 256 MB Ram
Murder of ravens
20
Years of Service
User Offline
Joined: 17th Jul 2004
Location:
Posted: 12th Nov 2004 05:27
ahh raven isnt an admin or a moderator is he? cause i like this name :p
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 12th Nov 2004 07:03
Quote: " ahh raven isnt an admin or a moderator is he?"


I'll try and find some classic Raven threads for you. They're amazing.

Does anyone know what the nFinity thread was called?
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 12th Nov 2004 08:03
Click on Mouses sig i think

Song of the whenever i feel like updating it....
Man in a Dream, by Stew
Murder of ravens
20
Years of Service
User Offline
Joined: 17th Jul 2004
Location:
Posted: 13th Nov 2004 07:13
classic raven threads? everyone seems to know him. im supprised i havnt met him
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 13th Nov 2004 07:47
you will soon enough

Song of the whenever i feel like updating it....
Man in a Dress, by Stew
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 13th Nov 2004 07:50
Keep an open mind towards all users and judge him for yourself.



A book? I hate book. Book is stupid.
(Formerly known as Yellow)
Murder of ravens
20
Years of Service
User Offline
Joined: 17th Jul 2004
Location:
Posted: 13th Nov 2004 19:08
Quote: "Keep an open mind towards all users and judge him for yourself."
Good advice, i will do
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 14th Nov 2004 03:26
Jump over to the general talk forum and look around. You'll find him soon enough.

Xander Moser - Bolt Software - Firewall

Login to post a reply

Server time is: 2024-11-27 15:33:03
Your offset time is: 2024-11-27 15:33:03