mirror of
https://github.com/libretro/lutro-game-of-life.git
synced 2025-02-16 23:08:59 +00:00
20 lines
341 B
Lua
20 lines
341 B
Lua
AliveCell = Cell.new()
|
|
AliveCell.__index = AliveCell
|
|
|
|
function AliveCell.new(n)
|
|
local self = setmetatable({}, AliveCell)
|
|
return self
|
|
end
|
|
|
|
function AliveCell:getColor()
|
|
return 102, 0, 102
|
|
end
|
|
|
|
function AliveCell:nextGeneration(neighbour)
|
|
if neighbour==2 or neighbour==3 then
|
|
cell=self
|
|
else
|
|
cell = DeadCell.new()
|
|
end
|
|
return cell
|
|
end |