Hey lovers how do i use random function?
I initialized it using these lines of code :
math.random(os.time()) SOLVE IT : i forgot to add randomseed , ups
math.random()
math.random()
math.random()
smt = math.random(600)
print(smt)
Everytime when i run the app it gives me the same number 293,why? I really need to learn how to use random function because i need it into my game.
Thanks for your help!
How do i use random?SOLVE
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
How do i use random?SOLVE
Last edited by buhb11 on Wed Apr 10, 2013 5:37 pm, edited 3 times in total.
I found Love very enjoyable and nice!
Re: How do i use random?
what's the issue? it seems to be working fine.
Re: How do i use random?
It gives me the same number over and over again,293 even if i restart the appJackim wrote:what's the issue? it seems to be working fine.
I found Love very enjoyable and nice!
Re: How do i use random?SOLVE
LÖVE 0.8.0 automatically does that right before calling love.load, so you don't need to do this as long as you don't call math.random before love.load
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: How do i use random?SOLVE
Thx,good to know!Nixola wrote:LÖVE 0.8.0 automatically does that right before calling love.load, so you don't need to do this as long as you don't call math.random before love.load
I found Love very enjoyable and nice!
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest