buttercheetah

Game system control

Aug 5th, 2021 (edited)
1,112
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local component = require("component")
  2. local event = require("event")
  3. local m = component.modem -- get primary modem component
  4. while (1==1) do
  5.   os.execute("cls")
  6.   print("1) computer 1")
  7.   print("2) computer 2")
  8.   print("3) computer 3")
  9.   local sel = io.read()
  10.   if (sel=="1") then
  11.     print("Enter new score")
  12.     local num = io.read()
  13.     m.broadcast(1, " " .. num)
  14.   end
  15.   if (sel=="2") then
  16.     print("Enter new score")
  17.     local num = io.read()
  18.     m.broadcast(2, " " .. num)
  19.   end
  20.   if (sel=="3") then
  21.     print("Enter new score")
  22.     local num = io.read()
  23.     m.broadcast(3, " " .. num)
  24.   end
  25. end
RAW Paste Data