class IGOL::GameOfLife

Overview

Represents a mutable GoL grid

Defined in:

igol/state.cr

Constant Summary

OriginSquare = [{-1, 1}, {0, 1}, {1, 1}, {-1, 0}, {0, 0}, {1, 0}, {-1, -1}, {0, -1}, {1, -1}]

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(population : Set(Point) = Set(Point).new) #

[View source]

Class Method Detail

def self.random(max_size = 100, x_range = 1..10, y_range = 1..10) #

[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def [](idx) #

[View source]
def add(cells : Set(Point)) #

[View source]
def copy(population = @population) : GameOfLife #

[View source]
def draw(x_range = -4..4, y_range = -4..4) #

[View source]
def evolve(iterations = 1) #

[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def population : Set({Int32, Int32}) #

def remove(cells : Set(Point)) #

[View source]
def to_named_tuple #

[View source]
def to_s(io) #

[View source]
def to_tuple #

[View source]

Macro Detail

macro []=(population_pattern, rhs) #

[View source]