Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GameOfLife

This is a simple implementation of the Conway's Game of Life for the Terminal.

It's built with Gradle and requires Java 25.

Running it

./gradlew run

This runs with the default settings: a 9x16 grid, the PENTADECATHLON pattern, for 16 generations.

Parameters

All parameters are optional and can be overridden independently via Gradle properties:

Parameter Description Default
rows Number of rows in the grid 9
columns Number of columns in the grid 16
executions Number of generations to simulate 16
pattern Starting pattern (see below) PENTADECATHLON
./gradlew run -Pexecutions=30 -Ppattern=SIMPLE_BLINKER

Available patterns (defined in PatternsEnum): PENTADECATHLON, SIMPLE_BLINKER, MULTI_BLINKERS.

Rendering

Display is handled through the GridRenderer interface, so how a generation is shown is decoupled from the grid's own simulation logic.
The default implementation, ConsoleRenderer, clears the terminal and redraws each generation using ANSI escape codes and colors.

Tests

./gradlew test

Here is an animation of the fifteen states of a Pentadecathlon as displayed in the Terminal. Pentadecathlon

About

A simple implementation of the Conway's Game of Life for the Terminal.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages