choice, winning = {}, { r = 's', p = 'r', s = 'p' }
for n=1, 2 do
print( ("Player %d:\nType 'r' for rock, 'p' for paper, or 's' for scissors and press return."):format( n ) )
while not choice[n] do choice[n] = io.read():match"^[rps]" end
end
print( choice[1]==choice[2] and "Draw!" or ("Player %d wins!"):format( winning[choice[1]]==choice[2] and 1 or 2 ) )
choice, winning = {}, { r = 's', p = 'r', s = 'p' }
for n=1, 2 do
os.execute("cls")
os.execute("clear")
print( ("Player %d:\nType 'r' for rock, 'p' for paper, or 's' for scissors and press return."):format( n ) )
while not choice[n] do choice[n] = io.read():match"^[rps]" end
end
print( choice[1]==choice[2] and "Draw!" or ("Player %d wins!"):format( winning[choice[1]]==choice[2] and 1 or 2 ) )
I added something to clear the terminal, so the second player can't read the first choice
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics