RosettaCodeData/Task/Wireworld/00DESCRIPTION

53 lines
1.6 KiB
Text
Raw Permalink Normal View History

2015-02-20 00:35:01 -05:00
{{omit from|GUISS}}
2016-12-05 22:15:40 +01:00
2015-02-20 00:35:01 -05:00
[[wp:Wireworld|Wireworld]] is a cellular automaton with some similarities to [[Conway's Game of Life]].
2013-04-11 01:07:29 -07:00
2015-02-20 00:35:01 -05:00
It is capable of doing sophisticated computations with appropriate programs
(it is actually [[wp:Turing-complete|Turing complete]]),
and is much simpler to program for.
2016-12-05 22:15:40 +01:00
A Wireworld arena consists of a Cartesian grid of cells,
2015-02-20 00:35:01 -05:00
each of which can be in one of four states.
All cell transitions happen simultaneously.
The cell transition rules are this:
2013-04-11 01:07:29 -07:00
{| class=wikitable
|-
! Input State
! Output State
! Condition
|-
| <tt>empty</tt>
| <tt>empty</tt>
|
|-
| <tt>electron&nbsp;head&nbsp;</tt>
| <tt>electron&nbsp;tail&nbsp;</tt>
|
|-
| <tt>electron&nbsp;tail&nbsp;</tt>
| <tt>conductor</tt>
|
|-
| valign=top | <tt>conductor</tt>
| valign=top | <tt>electron&nbsp;head&nbsp;</tt>
| if 1 or 2 cells in the [[wp:Moore neighborhood|neighborhood]] of the cell are in the state “<tt>electron head</tt>”
|-
| <tt>conductor</tt>
| <tt>conductor</tt>
| otherwise
|}
2016-12-05 22:15:40 +01:00
;Task:
Create a program that reads a Wireworld program from a file and displays an animation of the processing. Here is a sample description file (using "<tt>H</tt>" for an electron head, "<tt>t</tt>" for a tail, "<tt>.</tt>" for a conductor and a space for empty) you may wish to test with, which demonstrates two cycle-3 generators and an inhibit gate:
2013-04-11 01:07:29 -07:00
<pre>
tH.........
. .
...
. .
Ht.. ......
</pre>
While text-only implementations of this task are possible, mapping cells to pixels is advisable if you wish to be able to display large designs. The logic is not significantly more complex.
2016-12-05 22:15:40 +01:00
<br><br>