Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cellular Automata in Haskell

A generic cellular automata engine made in Haskell. It was initially implement as a pure functional program using Vector.Unboxed but was transitioned to Vector.Storable.Mutable for comfortable interop with JavaScript through WebAssembly. This enables direct mutation of memory, which has side effects.

Check out my portfolio for a live demo.

Running in the console

Requirements

  • Cabal 3.16
$ cabal run . <options>

For example:

cabal run . -- ./patterns/conway/oscillator.toml

This causes the program to take over the terminal and display the defined pattern in ./patterns.

Alternatively:

$ cabal run . --                    \
    <conway | seeds | bb | ww>      \   # default = conway
    <amount of generations to run>  \   # default = 1000
    <grid width>                    \   # default = 30
    <grid height>                   \   # default = 30
    <seed>                          \   # default = posix time
    <density>                       \   # default = depends on select automaton
    <delay>                         \   # default = 100000 (in µs)

This will create a randomised initial state from the current POSIX time or from the provided seed. All arguments are optional, but there are defaults.

About

A generic cellular automata engine made in Haskell. WASM compatible.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages