side = "back"
msg = "Score: "
score = 0
local m = peripheral.wrap(side)

function updatescore()
m.setTextScale(5)
m.clear()
m.setBackgroundColor(colors.orange)
m.setCursorPos(4,3)
m.write(msg..score)
end

function resetscores()
score = 0
updatescore()
end

updatescore()
while true do
rs.getInput("left")
rs.getInput("right")
if rs.getInput("left") == true then
score = score+1
updatescore()
end
if rs.getInput("right") == true then
resetscores()
end
sleep(0.5)
end
