“Nomor acak Lua” Kode Jawaban

Cara mendapatkan nomor acak di Lua

local randomNumber1 = math.random(1, 10) --Returns a number between 1 and 10.
local randomNumber2 = math.random(10) --Also returns a number between 1 and 10.

print(randomNumber1, randomNumber2) --OUTPUT EXAMPLE: "6, 8"
Adxm

Nomor acak Lua

local number = math.random(1, 10)
# change 1 to be the smallest possible number
# change 10 to the be the biggest possible number
panda

pencetakan nomor acak lua

local randomnumber = Math.Random(1, 10) -this is a random number between 1 and 10
local canprint = True
local count = 0

while canprint do --gonna loop when canprint is true
    Print(randomnumber) --gonna print random number
    wait(1) --waiting one sec
    count = count + 1 --gonna count to one. it will say that we have done it 1 time already
    if count == 10 then --if we print it 10 times it will count canprint as false
        canprint = false        
dl.idiot..

Jawaban yang mirip dengan “Nomor acak Lua”

Pertanyaan yang mirip dengan “Nomor acak Lua”

Lebih banyak jawaban terkait untuk “Nomor acak Lua” di Lua

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya