Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
interesting rnd problem
#1
um, ok... i made a rnd number generator

Code:
dim i as integer
dim a as integer

for i = 1 to 16
a = rnd * 10
print a
next

sleep

every time i run it, it gives me the same number, so if i run it, then clsoe it and run it again, i get the exact same number over and over... why? shouldnt it generate a random number?
url=http://www.random-seed.net][Image: asylumsig.png][/url]
Reply
#2
You need Randomize Timer befor it will do it tho:

Code:
dim i as integer
dim a as integer

randomize timer
for i = 1 to 16
a = rnd * 10
print a
next

sleep

:wink: Now try it..
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#3
Randomize
Reply
#4
blatant rtfm... ;p
Reply
#5
You know, don't they have one for FB?

Randomize (FB Wiki)

:lol: :wink:
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#6
wikka wakka...

lol... :lol:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)