Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Generating a random number?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
goldengold
Grandmaster Cheater Supreme
Reputation: -1

Joined: 11 Nov 2006
Posts: 1841
Location: -.-

PostPosted: Thu Nov 08, 2007 4:42 am    Post subject: Generating a random number? Reply with quote

I jsut read somewhere that it said it was impossible ofr a computer to generate a random number.


Like just say generaterandomnumber()

_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Thu Nov 08, 2007 4:48 am    Post subject: Reply with quote

srand();
rand(time(NULL));
Back to top
View user's profile Send private message MSN Messenger
assaf84
Expert Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 238

PostPosted: Thu Nov 08, 2007 4:52 am    Post subject: Reply with quote

Well, It's not exactly random, but very close to it. it depends on the time the function is called, which is not that random in some cases. Still, it's good enough for anything you need
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Thu Nov 08, 2007 5:17 am    Post subject: Reply with quote

a random number CAN have parameters.

Say i want a randnum between 1 and 23232323. Even if i make it so it will be in those, its still random because the computer is not given an initial value.

_________________
Back to top
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Thu Nov 08, 2007 6:20 am    Post subject: Reply with quote

text 1 = Rnd(999 * rnd)
Back to top
View user's profile Send private message
Hackerdevelopment
Advanced Cheater
Reputation: 0

Joined: 11 Oct 2007
Posts: 55

PostPosted: Thu Nov 08, 2007 6:45 am    Post subject: Reply with quote

Wat kind of programming?
_________________
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Thu Nov 08, 2007 9:52 am    Post subject: Reply with quote

noz3001 wrote:
srand();
rand(time(NULL));


int random;
srand(time(NULL));
random = rand();
Back to top
View user's profile Send private message
goldengold
Grandmaster Cheater Supreme
Reputation: -1

Joined: 11 Nov 2006
Posts: 1841
Location: -.-

PostPosted: Thu Nov 08, 2007 10:12 am    Post subject: Reply with quote

Lol k thanks. btw im not programming anything. (couldn't even if i wanted to.)

But i found a TUT for kids which is alot easier than the other books ive read so yay

_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Thu Nov 08, 2007 10:12 am    Post subject: Reply with quote

Too easy to see the pattern from GetTickCount. Use CryptGenRandom or Boost::Random
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites