Skip to content

nodatapoints/wire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cellular Wire Automaton

Generating a Sierpinski Triangle

Installation

Get SFML.

$ sudo apt install libsfml-dev

Clone the repository and build the source

$ git clone https://github.com/nodatapoints/wire
$ cd wire
/wire $ make
/wire $ ./wire

About

A minimalistic cellular automaton capable of simulating logic circuits.

The Rules

In an infinite grid of square cells, there are for states:

  1. Empty
  2. Wire
  3. Blocking
  4. Active

At each point in time, every cell is in exactly one state. As time progresses, the states change from one generation to the next.
All cells change simultaneously according to the following rules:

In the next generation, a cell will change to state

  1. ... Empty if it is Empty
  2. ... Wire if it is Blocking
  3. ... Blocking if it is Active
  4. ... Active if it is Wire and it has an odd number of active neighbors with a shared edge.

The Controls

There are two modes:

  • The Edit Mode allows you to edit cells while time is halted. You will start in this mode.
  • The Run Mode allows you to simulate what you've built.

Edit Mode

The gray square is your cursor. On left click, you will set a wire at the cursor position. On right click you will delete it. Pressing Shift while clicking left will set an active cell.

When holding Ctrl, you can make a rectangular selection. Clicking will set the whole selection like it would with a single cell.
Pressing X cuts the current selection, C copies it. You will see the selection hover and move with the cursor. Pressing V pastes the clipboard at the current position. Once you're done, Esc will cancel pasting.

Run Mode

When pressing Space, the simulation will start running. It can be paused and continued with P. When paused, you can run it step by step using S.
To start in paused, press S instead of Space.

To exit the Run Mode, press Space or Escape again. Otherwise it will exit automatically once there are no active cells present.
After exiting, the state before running will be resumed.

To exit the game, press Q

About

A minimalistic Cellular Automaton

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published