Skip to content

The Game of Life is a cellular automaton devised by the British mathematician John Horton Conway in 1970.

Notifications You must be signed in to change notification settings

kirull1/Conway-s-Game-of-Life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Conway's Game of Life

Пример использования

$game = new game;

// Создание карты.
// Первый параметр - размер карты.
// Второй параметр - процент заполненность живыми клетками.
$game->generate(30, 25);

// Создание карты со своей вставкой.
// Первый параметр - размер карты.
// Второй параметр - матрица со вставкой.
// Третий параметр - массив смещения.
$game->build_map(30, [['▓▓','░░','░░'], ['░░','▓▓','▓▓'], ['▓▓','▓▓','░░']], [3, 3]);

// Запуск бесконечного цикла
while(true){
    $game->update_map(); // Обновить карту.
    echo $game->compile(1)."\n"; // Вывод. Можно указать отступы.
}

About

The Game of Life is a cellular automaton devised by the British mathematician John Horton Conway in 1970.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages