Skip to content

A simple Game of Life implementation which is usable from the REPL

License

Notifications You must be signed in to change notification settings

ChristianKurz/REPLGameOfLife.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REPLGameOfLife

This is a proof of concept.

Play Conways Game Of Life directly in the Julia REPL! This uses braille symbols to increase resolution and rendering speed, similar to the BrailleCanvas from UnicodePlots.jl

Playing in the VSCode REPL:

Screenshot

Installation

REPLGameOfLife is registered in METADATA and can be installed using the package manager:

#enter package manager with ]
(v0.7) pkg> add REPLGameOfLife

Playing

After Installation, use the Package (using REPLGameofLife) and start a game with gameoflife() or its short form gol().

Keyword arguments:

  • pause: Set the time between frames
  • survive: How many live neighbors are needed to survive
  • birth: how many live neighbors are needed for a birth

Environments and Presets

You can provide a starting environment as an array of 1's and 0's:

gol([
    0 0 0 0 0 0
    0 0 0 1 0 0
    0 0 0 0 1 0
    0 0 1 1 1 0
    0 0 0 0 0 0
])

Alternatively you can start gol(p::Preset, size::Tuple(Int,Int)) using a preset:

gameoflife(Glider(), (40, 40))

Currently the following Presets are available:

  • Glider
  • BHeptomino
  • GosperGun

PRs are welcome!

About

A simple Game of Life implementation which is usable from the REPL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages