3
rnd
JailDoctor edited this page 2022-02-18 19:26:05 +01:00

rnd(max)

Ens torna un valor sencer aleatori entre 0 i max-1.

Paràmetres

max Nombre sencer.

Exemple

function init()
    mode(2)
end

function update()
    cls()
    for y=0,14 do
        for x=0,19 do
            locate(x,y)
            color(rnd(16),rnd(16))
            print(chr(rnd(256)))
        end
    end
end

Vore també