6IMXFIXTW3MOK6ASUSJTULWBNNCPLGKUHVBPUP4FMP3UNQGV6CJAC
arena:setCell(pos + dirFromString(direction), Cell{owner=self.owner, core=fun, energy=self.energy * energy})
local oldEnergy = self.energy
local cell = Cell{owner=self.owner, core=fun, energy=self.energy * energy}
arena:setCell(pos + dirFromString(direction), cell, function()
self.energy = oldEnergy
end)
function Arena:draw()
for y = 1, height do
for _ = 1, width*7 do
io.write("-")
end
io.write("\n|")
for x = 1, width do
local owner = self:getCell(Vector(x, y)).owner
io.write(string.format("%-5s", tostring(owner):sub(5)))
io.write("|")
end
io.write("\n")
for _ = 1, width*7 do
io.write("-")
end
io.write("\n")
end
end