Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

Wireworld

Guides

  • Wireworld

Tech Notes

  • Wireworld Package

Symbols

  • WireworldDraw
  • WireworldEvolve
  • WireworldPlot
  • WireworldStateQ
  • $WireworldFunctionRule
  • $WireworldNumberRule
Wireworld Package
​
The functions defined in the Wireworld` package provide tools for exploring the Wireworld Turing-complete cellular automaton.
Load the package:
In[316]:=
<<Wireworld`

States and Cells

Wireworld is a cellular automaton which can be in one of four different cells:
0
an empty cell
1
an electron head
2
an electron tail
3
a wire cell
Wireworld cells.
Electron heads are considered alive. Electron cells and wire cells are considered to be dead.
Wireworld is a two-dimensional cellular automaton, which means a valid state must be a matrix where each element is one of the cells mentioned above:
WireworldStateQ
[expr]
test whether
expr
is a matrix of Wireworld cells
Testing valid Wireworld states.
Here is a valid Wireworld state:
In[44]:=
WireworldStateQ
[{​​{0,0,0,0,3,3,0,0,0,0},​​{3,3,2,1,3,0,3,3,2,1},​​{0,0,0,0,3,3,0,0,0,0}​​}]
Out[44]=
True
Sparse arrays can also be matrices:
In[51]:=
WireworldStateQ
SparseArray
Specified elements: 15
Dimensions: {3,10}

Out[51]=
True

State Visualization and Edition

WireworldPlot
[state]
plot a Wireworld
state
Plotting a Wireworld state.
Plot a Wireworld state:
In[318]:=
WireworldPlot
SparseArray
Specified elements: 62
Dimensions: {13,24}

Out[318]=
WireworldDraw
[{h,w}]
draw a Wireworld state with dimensions
{d,h}
WireworldDraw
[state]
edit a Wireworld
state
Drawing Wireworld states.
Open a window to draw a Wireworld state with 12 rows and 22 columns:
WireworldDraw
[{12,22}]
Edit an already existing Wireworld state:
WireworldDraw
SparseArray
Specified elements: 62
Dimensions: {13,24}

To obtain the drawn state, press the
"Return"
key:
In[317]:=
WireworldDraw
[{12,22}]
Out[317]=
SparseArray
Specified elements: 58
Dimensions: {12,22}


Wire Rules

As mentioned before, Wireworld is a two-dimensional
CellularAutomaton
. It uses the Moore neighborhood, which means the evolution of any one cell depends on all neighbours that are one cell away in any direction.
In each generation:
1
.
Wire cells with 1 or 2 live neighbours (electron heads) turn into electron heads
2
.
Electron heads turn into electron tails
3
.
Electron tails turn into wire cells
Empty cells are just that: empty cells. They neither change nor interact with the other cells.
WireworldEvolve
[state,t]
evolve a Wireworld state
init
for
t
steps
Evolving a Wireworld state.
Compute the evolution of a Wireworld state for 3 steps:
In[359]:=
WireworldEvolve
SparseArray
Specified elements: 14
Dimensions: {5,11}
,3
Out[359]=
SparseArray
Specified elements: 14
Dimensions: {5,11}
,SparseArray
Specified elements: 14
Dimensions: {5,11}
,SparseArray
Specified elements: 14
Dimensions: {5,11}
,SparseArray
Specified elements: 14
Dimensions: {5,11}


Electrons

An electron consists of a head and a tail. Along a line of wire cells, it will propagate in the direction pointed by the head.
An electron moving along a wire:
In[366]:=
GraphicsColumn
WireworldPlot
/@
WireworldEvolve
SparseArray
Specified elements: 21
Dimensions: {3,21}
,3
Out[366]=
Electrons can turn around corners:
An electron meets a fork in the road:
An electron caught in a loop will go around it forever:
Split off a fork from the loop to create an electron source:

The Diode

A diode allows the flow of electrons in only one direction:
An electron flowing the "right" way through a diode:
An electron flowing the "wrong" way through a diode:

Logic Gates

An OR gate fed by two electron sources:
An XOR gate fed by two electron sources:

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com