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