/gol

Zellij plugin to play around with the game of life

Primary LanguageRust

gol

A Zellij plugin for enjoying the Conway's game of life.

usage

Usage

  • s start
  • r reset
  • Up and Down or j and k to change the density of the random initial population
  • Left and Right or h and l to change the time speed

Why?

Why not?

More seriously, it is actually quite fun to play around with the game of life to get a feel for the idea of emergence, as you play with different speeds and densities you will notice that certain configurations seem "noisy" while simply changing the speed will bring a certain beautiful order out of the noise.

Installation

You'll need rust installed.

  • git clone git@github.com:Nacho114/gol.git
  • cd gol
  • cargo build --release
  • mkdir -p ~/.config/zellij/plugins/
  • mv target/wasm32-wasi/release/gol.wasm ~/.config/zellij/plugins/

Keybinding

Add the following to your zellij config somewhere inside the keybinds section:

shared_except "locked" {
    bind "Ctrl y" {
        LaunchOrFocusPlugin "file:~/.config/zellij/plugins/gol.wasm" {
            floating true
        }
    }
}

You likely already have a shared_except "locked" section in your configs. Feel free to add bind there.## Contributing

If you find any issues or want to suggest ideas please open an issue.

Development

Make sure you have rust installed then run:

zellij action new-tab --layout ./dev.kdl

Testing

To run tests:

cargo test --target aarch64-apple-darwin -- --nocapture

Replace the target the appropriate cpu architecture.