How do I add up rolls one through ten and display them?
math.randomseed(os.time())
– with a ‘while’ loop:
rolls = 0
while rolls < 10 do
rolls = rolls + 1
d1 = math.random(1,6)
print("Roll “…rolls…” is “…d1…”)
end
How do I add up rolls one through ten and display them?
math.randomseed(os.time())
– with a ‘while’ loop:
rolls = 0
while rolls < 10 do
rolls = rolls + 1
d1 = math.random(1,6)
print("Roll “…rolls…” is “…d1…”)
end
Hi,
Something like this?
math.randomseed(os.time()) -- with a 'while' loop: local rolls = 0 local d1 = 0 while rolls \< 10 do rolls = rolls + 1 d1 = d1 + math.random(1,6) print("Roll "..rolls.." is "..d1) end
burhan
Hi,
Something like this?
math.randomseed(os.time()) -- with a 'while' loop: local rolls = 0 local d1 = 0 while rolls \< 10 do rolls = rolls + 1 d1 = d1 + math.random(1,6) print("Roll "..rolls.." is "..d1) end
burhan