Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

TIC-80

Fantasy computer for making, playing and sharing tiny games. · By Nesbox

how can we get random numbers?

A topic by nitrofurano created Nov 22, 2017 Views: 4,158 Replies: 4
Viewing posts 1 to 4

how can we get random numbers? i tried everything from lua documentation and examples, nothing worked...

(+1)

use the math.random

(+4)

math.random () = float between 0 and 1

math.random (n1) = between 0 and nb1

math.random (n1, n2) = between n1 and n2

thanks

thanks! it's working! (updated https://tic.computer/play?cart=321 )