AngryMaking a randomizer...

Posts 16–30 of 41 · Page 2 of 3
Quote Originally Posted by xMeltdowNx View Post
Yes but the 'same' means it will give you the same box value more than once e.g. you will get 2000 twice and the money values aren't random, there selection is.
You are making no sense right now.

IT WON'T GIVE YOU THE SAME BOX AMOUNT
THE BOX AMOUNT IS REMOVED AFTER EACH RANDOM
Quote Originally Posted by rileyjstrickland View Post
You are making no sense right now.

IT WON'T GIVE YOU THE SAME BOX AMOUNT
THE BOX AMOUNT IS REMOVED AFTER EACH RANDOM
I take it back, I just tested it and it works. I don't know why but this didn't work for me when I was making my function so I thought this wouldn't work.
Quote Originally Posted by xMeltdowNx View Post
What are you talking about? It randomizes it every time you just added some unnecessary code which makes no difference.

To prove this I made an example (below)

Virustotal
Jotti
Because of how the random function works in all programming languages, a computer cannot generate a truly random sequence without being seeded. Let me find something about it for you because you've clearly never heard about this.

Truly Random Numbers (Using Seeds)

The code that he has here:
Code:
Dim objRandom As New System.Random( _
  CType(System.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer))
is what we call seeding. He's seeding the amount of ticks between 1970-something and now. We do this so that no matter what we're doing, our random number is always truly random instead of the "random" numbers always returning the same due to the default seed value as defined by the machine. I personally prefer to use a stopwatch and check for elapsed milliseconds for seeding instead of using "System.DateTime.Now.Ticks" but to each his own, both will return different values because it modifies the algorithm for random values.

Read the entire page as well, it's very useful in higher level programming.
Quote Originally Posted by LilGho$t View Post
Because of how the random function works in all programming languages, a computer cannot generate a truly random sequence without being seeded. Let me find something about it for you because you've clearly never heard about this.

Truly Random Numbers (Using Seeds)

The code that he has here:
Code:
Dim objRandom As New System.Random( _
  CType(System.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer))
is what we call seeding. He's seeding the amount of ticks between 1970-something and now. We do this so that no matter what we're doing, our random number is always truly random instead of the "random" numbers always returning the same due to the default seed value as defined by the machine. I personally prefer to use a stopwatch and check for elapsed milliseconds for seeding instead of using "System.DateTime.Now.Ticks" but to each his own, both will return different values because it modifies the algorithm for random values.

Read the entire page as well, it's very useful in higher level programming.
If you want to seed the function then fine but I really don't think you need to fully randomize these boxes, just shuffle them.
Quote Originally Posted by xMeltdowNx View Post
If you want to seed the function then fine but I really don't think you need to fully randomize these boxes, just shuffle them.
You need to seed, otherwise everytime the apps starts, the boxes will/should be at the same places. (Didn't bother to check what is actually being done, but this is what usually happens on a normal random)
So yes, LilGho$t is correct.
They aren't the same when it first loads thought, I checked and posted an example program which uses the function here.
Quote Originally Posted by xMeltdowNx View Post
They aren't the same when it first loads thought, I checked and posted an example program which uses the function here.
You need to seed or each time your run it it was always be in the same order/shuffled the same. So, if a user wants to play 2 games let's say the first box is $6,000, next time they play that box will again be $6,000 because it can't uniquely shuffle each time unless you use a seed.
Quote Originally Posted by LilGho$t View Post
You need to seed or each time your run it it was always be in the same order/shuffled the same. So, if a user wants to play 2 games let's say the first box is $6,000, next time they play that box will again be $6,000 because it can't uniquely shuffle each time unless you use a seed.
Download the example, run it and click randomize then post how many times the numbers come up in the same order.
Quote Originally Posted by xMeltdowNx View Post
Download the example, run it and click randomize then post how many times the numbers come up in the same order.
I'm not going to bother because i know i'm right. The only thing that could potentially make it "random" would be passing a different value into the .Next function each time.
Quote Originally Posted by LilGho$t View Post
I'm not going to bother because i know i'm right. The only thing that could potentially make it "random" would be passing a different value into the .Next function each time.
If you know your right then do it
Quote Originally Posted by xMeltdowNx View Post
If you know your right then do it
First of all, i don't run programs made by people with 14 posts, 8 or so of which have probably been generated by our conversation, and i don't need to run it to know unless you're passing a different value into the .next function each time, it wont be random.
Quote Originally Posted by LilGho$t View Post
First of all, i don't run programs made by people with 14 posts, 8 or so of which have probably been generated by our conversation, and i don't need to run it to know unless you're passing a different value into the .next function each time, it wont be random.
What do you mean you don't run programs from people with 14 posts? Just run it sandboxed. And you saw the function on the first page, the same value is run though it each time which is 26.
I am confused ):
Quote Originally Posted by papadoo View Post
I am confused ):
Simple answer is just seed your random number generator with an ever changing number instead of just saying "dim rnd as new random()" and leaving it at that ass hattery. Anyone who tells you different is inexperienced & clueless about how random numbers work.
Quote Originally Posted by LilGho$t View Post
Simple answer is just seed your random number generator with an ever changing number instead of just saying "dim rnd as new random()" and leaving it at that ass hattery. Anyone who tells you different is inexperienced & clueless about how random numbers work.
She doesn't need it to be seeded anyways, especially if she uses my functions.
While Yes, I do admit it will follow a specific pattern, she doesn't need to really worry that much about it, because it's "just" random enough to do the job.

Seeding is only when you truly need a pure random, such in the case of encryption, but this?, no.
Posts 16–30 of 41 · Page 2 of 3

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us