@@ -24,13 +24,13 @@ The state transitions are given by:
...
@@ -24,13 +24,13 @@ The state transitions are given by:
**Wire* becomes *Electron head*, if the number of *Electron heads* in the 8 neighboring cells is 1 or 2, otherwise it stays *Wire*.
**Wire* becomes *Electron head*, if the number of *Electron heads* in the 8 neighboring cells is 1 or 2, otherwise it stays *Wire*.
* An *Empty* cell is always left unchanged.
* An *Empty* cell is always left unchanged.
### Input file format
### Wireworld file format
The Wireworld file format is a simple text format taken over from [Mark Owen](http://www.quinapalus.com/cv.html), who presents on his website a [Wireworld computer](http://www.quinapalus.com/wi-index.html) designed by him and David Moore, which is capable of computing prime numbers.
The Wireworld file format is a simple plain text format. It is taken over from **Mark Owen**, who presents on his website a [Wireworld computer](http://www.quinapalus.com/wi-index.html) designed by him, **David Moore** and others, which is capable of computing prime numbers. We acknowledge that the example input file `primes.wi` is originating from [Mark Owen's website](http://www.quinapalus.com).
The first line of the input file contains 2 positive integers, specifying the width *W* (i.e. the number of cells in x-direction) and height *H* (i.e. the number of cells in y-direction) of the automaton.
The first line of a Wireworld file contains 2 positive integers, specifying the width *W* (i.e. the number of cells in x-direction) and height *H* (i.e. the number of cells in y-direction) of the automaton.
The header is followed by exactly *H* lines of length *W*, which represent a 2-dimensional character array, encoding the individual cell states as follows:
The header is followed by exactly *H* lines containing exactly *W* characters (excluding the terminating line break character `'\n'`), representing the state of the cellular automaton. The individual cell states are encoded as follows:
| Character | State |
| Character | State |
|-------------|-----------------|
|-------------|-----------------|
...
@@ -39,7 +39,7 @@ The header is followed by exactly *H* lines of length *W*, which represent a 2-d
...
@@ -39,7 +39,7 @@ The header is followed by exactly *H* lines of length *W*, which represent a 2-d
| `'#'` | *Wire* |
| `'#'` | *Wire* |
| (any other) | *Empty* |
| (any other) | *Empty* |
An example input file (`diodes.wi`) containing 10x7 cells is given below (here, *Empty* is encoded as `'.'`):
As an example, a Wireworld file (`diodes.wi`) containing 10x7 cells is given below (*Empty* is here encoded as `'.'`):