Shortest Wireworld

5

enter image description here

Wireworld is fun for the whole family! Your goal is to create a Wireworld implementation in the shortest amount of code possible.

A Wireworld cell can be in one of four different states, usually numbered 0–3 in software, modeled by colors in the examples here:

  • Empty (Black)
  • Electron head (Blue)
  • Electron tail (Red)
  • Conductor (Yellow)

As in all cellular automata, time proceeds in ticks. Cells behave as follows:

  • Empty → Empty
  • Electron head → Electron tail
  • Electron tail → Conductor
  • Conductor → Electron head if exactly one or two of the neighbouring cells are electron heads, or remains Conductor otherwise.

Your grid must be at least 20 by 20 and must follow the rules of Wireworld. The grid doesn't have to be colored, but make sure it follows these numbers/symbols:

  • Empty (0 or ' ')
  • Electron head (2 or 'H')
  • Electron tail (3 or 'T')
  • Conductor (1 or '_')

phase

Posted 2015-07-03T04:44:02.573

Reputation: 2 540

Question was closed 2015-07-03T06:07:40.170

1What does the implementation need to do? Take an input state onto the output state one tick later? – xnor – 2015-07-03T05:05:10.930

Also, beware that Mathematica and probably other languages have built-ins for cellular automata. – xnor – 2015-07-03T05:09:21.343

@xnor it needs to run on a clock and tick ever few seconds or so – phase – 2015-07-03T05:10:40.217

does the board wrap? – Maltysen – 2015-07-03T05:30:54.893

As this is an unusual duplicate case, I'm going to ask a question on Meta about it. – Peter Taylor – 2015-07-03T06:08:11.163

No answers