Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not os.loadAPI("cutil") then
- error("checkers requires the Checkers util API (cutil) by minecraftwarlock to run")
- end
- sides = {"left","right","front","back","top","bottom"}
- modemSide = nil
- modDir = "checkers mods"
- if not fs.exists(modDir) then
- fs.makeDir(modDir)
- end
- for i=1,6 do
- if peripheral.isPresent(sides[i]) and peripheral.getType(sides[i]) == "modem" then
- if peripheral.call(sides[i],"isWireless") then
- print("Wireless modem found on "..sides[i])
- modemSide = sides[i]
- end
- end
- end
- rednet.open(modemSide)
- cutil.mon = peripheral.find("monitor")
- button.mon = peripheral.find("monitor")
- mon = peripheral.find("monitor")
- if mon == nil or not mon.isColor() then
- error("Checkers requires an advanced monitor to play")
- end
- gamemode = cutil.mainMenu()
- print("gamemode: "..gamemode.." selected")
- if gamemode == "lcl" then
- print("Drawing board of size 8x8")
- while cutil.noWinner() do
- print(cutil.opponent.." turn started")
- cutil.board(8,8)
- cutil.nextTurn()
- print(cutil.turn.." turn finished")
- end
- mon.clear()
- cutil.cntrdTxt(cutil.winner.." wins!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement