Code: Select all
@NUTSHELL WireworldModern
Wireworld Modern: with separate 1 and 0 signals, and other goodies.
1: {I} 1 head
2: tail
3: wire
4: {O} 0 head
5: {C} converter
6: {CO} converter with 0 head
7: {CI} converter with 1 head
8: converter with tail
@TABLE
symmetries:permute
d=(1,4) # bithead
b=--d # anti-bithead
e=(0,2,3) # vacuum, or wire but not bithead
c=--(5..8) # anti-converter
# Decay transitions
(d, 2, CO, CI, 8), any; [0: (2*d, 3, 8*d, C)]
# Electron propagation in standard wires
3, d ~ 1, b; [1]
# Two-electron collisions make gates, depending on configuration
symmetries:rotate4reflect
# 45-degree: NAND
3, N..SW b, W..NW d; [NW: (d - [W], I)]
# 90-degree orth: AND
3, NE..SW b, W d, b, N d; [N: ([W], O)]
# 90-degree diag: OR
3, N..S b, SW d, b, NW d; [NW: (I, [SW])]
# 135-degree: diag input AND NOT orth input
3, N..SE b, S d, SW..W b, NW d; [S: (O, [NW])]
# 180-degree: XOR (the orthogonal variation is only usable in p3 logic)
3, N d, NE..SE b, S d, SW..NW b; [N: (d - [S], [S])]
3, NW d, N..E b, SE d, S..W b; [NW: (d - [SE], [SE])]
# The following transitions deal with converter states
# A wire adjacent to exactly one converter, where that converter has a head, propagates the head
symmetries:permute
3, (CI, CO) ~ 1, c; [1: d]
# A converter not adjacent to any other converters which would turn into state 1 next generation
# if it were normal wire turns into state 7. This allows transitioning from WWM all-electrons representation
# to vanilla WW, and also allows selective blocking with an AND NOT gate; the other direction
# can be accomplished without converters
C, I ~ 1, e; CI
symmetries:rotate4reflect
# NAND
C, N..SW e, W..NW I; C
C, N..SW e, W..NW d; CI
# AND
C, NE..SW e, W I, e, N I; CI
# OR
C, N..S e, SW O, e, NW O; C
C, N..S e, SW d, e, NW d; CI
# ANDNOT
C, N..SE e, S O, SW..W e, NW I; CI
# XOR
C, N O, NE..SE e, S I, SW..NW e; CI
C, NW O, N..E e, SE I, S..W e; CI
# These transitions allow an "anycross" for crossing two wires completely asynchronously
symmetries:rotate4reflect
C, NW d, N..E any, SE (5, 8), S..W any; [NW: (CI, CO)]
C, NW e, N..E any, SE (CI, CO), S..W any; [SE]
@COLORS
48 48 48: 0
255 255 255: 1
150 150 150: 2
80 80 80: 3
56 68 209: 4
120 129 33: 5
125 141 131: 6
246 255 159: 7
182 191 95: 8
Code: Select all
@RULE WireworldModern
********************************
**** COMPILED FROM NUTSHELL ****
**** v0.5.7 ****
********************************
Wireworld Modern: with separate 1 and 0 signals, and other goodies.
1: 1 head
2: tail
3: wire
4: 0 head
5: converter
6: converter with 0 head
7: converter with 1 head
8: converter with tail
@TABLE
neighborhood: Moore
symmetries: rotate4reflect
n_states: 9
var any.0 = {0,1,2,3,4,5,6,7,8}
var any.1 = any.0
var any.2 = any.0
var any.3 = any.0
var any.4 = any.0
var any.5 = any.0
var any.6 = any.0
var any.7 = any.0
var d.0 = {1,4}
var d.1 = d.0
var b.0 = {0,2,3,5,6,7,8}
var b.1 = b.0
var b.2 = b.0
var b.3 = b.0
var b.4 = b.0
var b.5 = b.0
var b.6 = b.0
var e.0 = {0,2,3}
var e.1 = e.0
var e.2 = e.0
var e.3 = e.0
var e.4 = e.0
var e.5 = e.0
var e.6 = e.0
var c.0 = {0,1,2,3,4}
var c.1 = c.0
var c.2 = c.0
var c.3 = c.0
var c.4 = c.0
var c.5 = c.0
var c.6 = c.0
var _a0.0 = {8,5}
var _b0.0 = {6,7}
var _b0.1 = _b0.0
1, any.0, any.1, any.2, any.3, any.4, any.5, any.6, any.7, 2
4, any.0, any.1, any.2, any.3, any.4, any.5, any.6, any.7, 2
2, any.0, any.1, any.2, any.3, any.4, any.5, any.6, any.7, 3
6, any.0, any.1, any.2, any.3, any.4, any.5, any.6, any.7, 8
7, any.0, any.1, any.2, any.3, any.4, any.5, any.6, any.7, 8
8, any.0, any.1, any.2, any.3, any.4, any.5, any.6, any.7, 5
3, b.0, b.1, b.2, b.3, b.4, b.5, b.6, d.0, d.0
3, b.0, b.1, b.2, b.3, b.4, b.5, d.0, b.6, d.0
3, 1, 1, b.0, b.1, b.2, b.3, b.4, b.5, 4
3, 1, 4, b.0, b.1, b.2, b.3, b.4, b.5, 1
3, 4, 1, b.0, b.1, b.2, b.3, b.4, b.5, 1
3, 4, 4, b.0, b.1, b.2, b.3, b.4, b.5, 1
3, 1, b.0, 1, b.1, b.2, b.3, b.4, b.5, 1
3, 1, b.0, 4, b.1, b.2, b.3, b.4, b.5, 4
3, 1, b.0, 4, b.1, b.2, b.3, b.4, b.5, 4
3, 4, b.0, 4, b.1, b.2, b.3, b.4, b.5, 4
3, b.0, 1, b.1, 1, b.2, b.3, b.4, b.5, 1
3, b.0, 1, b.1, 4, b.2, b.3, b.4, b.5, 1
3, b.0, 1, b.1, b.2, b.3, b.4, b.5, 4, 1
3, b.0, 4, b.1, 4, b.2, b.3, b.4, b.5, 4
3, 1, b.0, b.1, 1, b.2, b.3, b.4, b.5, 4
3, 4, b.0, b.1, 1, b.2, b.3, b.4, b.5, 1
3, 1, b.0, b.1, 4, b.2, b.3, b.4, b.5, 4
3, 4, b.0, b.1, 4, b.2, b.3, b.4, b.5, 4
3, 1, b.0, b.1, b.2, 1, b.3, b.4, b.5, 4
3, 1, b.0, b.1, b.2, 4, b.3, b.4, b.5, 1
3, 1, b.0, b.1, b.2, 4, b.3, b.4, b.5, 1
3, 4, b.0, b.1, b.2, 4, b.3, b.4, b.5, 4
3, b.0, 1, b.1, b.2, b.3, 1, b.4, b.5, 4
3, b.0, 1, b.1, b.2, b.3, 4, b.4, b.5, 1
3, b.0, 1, b.1, b.2, b.3, 4, b.4, b.5, 1
3, b.0, 4, b.1, b.2, b.3, 4, b.4, b.5, 4
3, 7, c.0, c.1, c.2, c.3, c.4, c.5, c.6, 1
3, c.0, 7, c.1, c.2, c.3, c.4, c.5, c.6, 1
3, 6, c.0, c.1, c.2, c.3, c.4, c.5, c.6, 4
3, c.0, 6, c.1, c.2, c.3, c.4, c.5, c.6, 4
5, 1, e.0, e.1, e.2, e.3, e.4, e.5, e.6, 7
5, e.0, 1, e.1, e.2, e.3, e.4, e.5, e.6, 7
5, 1, 1, e.0, e.1, e.2, e.3, e.4, e.5, 5
5, d.0, d.1, e.0, e.1, e.2, e.3, e.4, e.5, 7
5, 1, e.0, 1, e.1, e.2, e.3, e.4, e.5, 7
5, e.0, 4, e.1, 4, e.2, e.3, e.4, e.5, 5
5, e.0, d.0, e.1, d.1, e.2, e.3, e.4, e.5, 7
5, 4, e.0, e.1, 1, e.2, e.3, e.4, e.5, 7
5, 1, e.0, e.1, e.2, 4, e.3, e.4, e.5, 7
5, e.0, 1, e.1, e.2, e.3, 4, e.4, e.5, 7
5, any.0, 1, any.1, any.2, any.3, _a0.0, any.4, any.5, 7
5, any.0, 4, any.1, any.2, any.3, _a0.0, any.4, any.5, 6
5, any.0, _b0.1, any.1, any.2, any.3, e.0, any.4, any.5, _b0.1
@COLORS
0 48 48 48
1 255 255 255
2 150 150 150
3 80 80 80
4 56 68 209
5 120 129 33
6 125 141 131
7 246 255 159
8 182 191 95