Want to play the game without contesting? Here’s a short code to copy:
function setup()
http.request("https://pastebin.com/raw/u5j4AS0R", function(d) loadstring(d)() setup() end, assert)
end
If you want to copy the game code and play it without internet connection, get the code here. Note! I have not implement an ending system yet, if you have issues with the code, please comment below!
Want to compete instead? Then this code is for you! Here’s the start code to copy:
function setup()
http.request("https://pastebin.com/raw/M26reBtr", function(d) loadstring(d)() setup()
-- Edit the code below
-- Is called when the table is changed.
ai.on("placed", function(...)
local args = {...}
if #args == 4 then
elseif #args == 6 then
end
end)
-- Is called when it is your turn, no income parameters
ai.on("turn", function()
local x, y, v = math.random(2, 9), math.random(2, 9), math.random(0, 1)
ai.send("place", x, y, x+v, y+1-v)
end)
ai.on("error", function(code, err)
print(code, err)
end)
-- Edit the code above
end, assert)
end
If you have edited the code, post it below, we’ll have temporary winners: If you post better code you’re as long winner till someone updates your code to be even more better!
KNOWN ISSUES
-
CallingFIXED: Exit code 1ai.send("place", ...)
more than one time inai.on("turn")
makes codea freeze. - There is no ending feature yet.