12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
|
| 14 Feb 2016 06:30 PM |
tonumber(tostring(tick()):sub(12))
this is sufficient
try
for i=1, 200 do math.randomseed(tonumber(tostring(tick()):sub(12))) print(math.random(1,5000)) end
i just had some problems with this before so i decided to release this you're welcome |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 Feb 2016 06:31 PM |
| Please tell me you're joking |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:31 PM |
You don't understand how math.random works. You should only ever set the seed once.
|
|
|
| Report Abuse |
|
|
h5s
|
  |
| Joined: 03 Jul 2014 |
| Total Posts: 1229 |
|
|
| 14 Feb 2016 06:33 PM |
| math.randomseed(tick()) will suffice instead of... Whatever the hell you were trying to do. |
|
|
| Report Abuse |
|
|
12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
| |
|
12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
|
| 14 Feb 2016 06:35 PM |
@h5 try this in studio
for i=1, 200 do math.randomseed(tick()) print(math.random(1,5000)) end
tell me what it outputs |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:35 PM |
Actually, it will.
Seriously though, I agree with cnt.
|
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:36 PM |
12103, what part of "DO NOT SET SEED MORE THAN ONCE OR YOU ARE DOING IT WRONG ALTOGETHER" do you not understand???
|
|
|
| Report Abuse |
|
|
12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
|
| 14 Feb 2016 06:37 PM |
| if you're not going to give me an explanation for why i shouldn't seed more than once, then you should just stop posting. |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:38 PM |
Because seeding isn't meant to happen more than once. Give a reason why you SHOULD.
And this is also better.
math.randomseed(tick()%1*1e6)
|
|
|
| Report Abuse |
|
|
12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
|
| 14 Feb 2016 06:39 PM |
| and then you'd do math.random 50 times in a second and they'd all be the same. nice. /s |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:40 PM |
Are you trolling? Get a life and stop. It's not very funny.
|
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 14 Feb 2016 06:40 PM |
"for i=1, 200 do math.randomseed(tonumber(tostring(tick()):sub(12))) print(math.random(1,5000)) end"
math.randomseed(tick())
for i = 1,200 do print(math.random(1,5000)) end
Will provide better results.
|
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:41 PM |
math.randomseed(tick()%1*1e6) will provide even better results though
|
|
|
| Report Abuse |
|
|
12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
|
| 14 Feb 2016 06:41 PM |
no chi it will provide the same result every time you guys don't listen |
|
|
| Report Abuse |
|
|
Agluk15
|
  |
| Joined: 13 Feb 2016 |
| Total Posts: 193 |
|
|
| 14 Feb 2016 06:41 PM |
@12103net
With your IQ of 1, no wonder your near vegetable intelligence.
(Please let this start another ^ so I am famous lol) |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:42 PM |
Okay, you are just trolling. I'm abandoning this flame bait.
|
|
|
| Report Abuse |
|
|
12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
|
| 14 Feb 2016 06:43 PM |
"Okay, you are just trolling. I'm abandoning this flame bait."
wtf y no stay i need more material
@ag
smart /s |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:44 PM |
12103 is right. Random number generations via computer using a seed is pretty bad. They repeat a lot of patterns usually and can be studied and predicted with high accuracy.
http://random.org explains their goals. |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:50 PM |
Yeah, he's right in that sense, but that's not the point he is trying to prove. He is arguing that setting the seed over and over is better than setting it once and letting it do it's stuff.
And unless you're actually a robot, you won't be able to predict the numbers.
|
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:51 PM |
| https://www.youtube.com/watch?v=olZN3Qh_g04 |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 Feb 2016 06:52 PM |
"And unless you're actually a robot, you won't be able to predict the numbers." That's not true, all you have to do is look at the implementation of the random function.
Also cody you're dumb, predictability doesn't make it bad. it's good enough for almost all intents and purposes. |
|
|
| Report Abuse |
|
|
12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
|
| 14 Feb 2016 06:52 PM |
@jarod
sometimes it works setting the seed once however, if you keep printing the numbers very, very quickly they aren't very different |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 06:53 PM |
It shouldn't make a difference the speed with which you draw the numbers, as far as I know. I don't think the algorithm is based on time.
|
|
|
| Report Abuse |
|
|
12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
|
| 14 Feb 2016 06:55 PM |
| it's happened to me before |
|
|
| Report Abuse |
|
|