Regarding random system
#1

I had a question, I made a dice system for my server and in there I've used SAMP random function.
I want to know if there is a way to know the upcoming 3 number( I know this doesn't make it random ) But if I roll a dice is there a way to know which number is going to be next. Because SAMP uses pseudo-random number and according to wiki this random function isn't fully random, and I learnt from somewhere where it says computer cannot just generate random numbers but follows a special sequence to generate a number for you.

If someone who is expert at this can explain me how SAMP itself uses random function to generate number?

I'd appreciate.
Reply
#2

Anyone?
Reply
#3

The random function generates a random integer value(I am not sure what it's based on) within the range of 0, and the given parameter(max param).

Basically: - any number between 0 up to(and or equal to) the max can be chosen. I am not really entirely sure as I wrote above exactly how the number is generated, but if someone told you its not random they're wrong.

There is no way to predict which one will be chosen next without actually calling the function, and retrieving the value.
Reply
#4

Uhm, Thought there was a way.
Reply
#5

Quote:
Originally Posted by Abagail
Посмотреть сообщение
The random function generates a random integer value(I am not sure what it's based on) within the range of 0, and the given parameter(max param).

Basically: - any number between 0 up to(and or equal to) the max can be chosen. I am not really entirely sure as I wrote above exactly how the number is generated, but if someone told you its not random they're wrong.

There is no way to predict which one will be chosen next without actually calling the function, and retrieving the value.
I don't think so, because computers cannot generate a random number. They use a sequence to generate the next number. They are not like humans.

Btw, humans too can't choose a random number. They does some calculations in their brain and tells a number, the calculations maybe small or big.

OT: I don't know the sequence which pawno uses.
Reply
#6

Well simple answer to your question will be NO.

Yes computers can not generate random numbers, they must use some pattern to archive random number, and if you know these pattern than you COULD predict numbers. But there are more factors except pattern and its a magic number(s) that is/are used to generate random number. Most random number generators i know depend on at least two things. First is magic number and second is computer current time (timestamp). Knowing pattern without these numbers is useless, plus these numbers are known to mutate (timestamp for example...)
Reply
#7

DRIFT_HUNTER is right - I managed to find the code for the "random" function and it indeed takes a timestamp and the so called "magic number" is just the number of times the function was called, and does calculations with it. So there's really no way for you to predict what the number might be.
Reply
#8

That's awfully weird a guy I know made a application which would show the upcoming random number. I don't know how he did it but he had a neat video demonstration. He deleted that from ******* and is not willing to leak the application.
Reply
#9

Anyone got any clues ideas?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)