Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.find "monitor"
- local wasCol = colors.green
- while true do
- local r = math.random()
- local col = nil
- if wasCol == colors.red then
- col = colors.orange
- elseif wasCol == colors.orange then
- if r >= 0.5 then
- col = colors.green
- else
- col = colors.red
- end
- elseif wasCol == colors.green then
- col = colors.red
- end
- mon.setBackgroundColor(col)
- mon.clear()
- wasCol = col
- sleep(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement