Wireworld Sim :D

2009-06-24 17:22:04 by trig1
Updated

I made a wireworld sim, which essentially is a (unbelievably basic) computer (it's Turing complete).

How to use: use the drop down box to select what type of cell you want to draw. Draw on the grid on the left using the mouse. Clean turns all the electron heads and tails into conductors in case you want to edit it without the electrons flying about. I'll let you work out what pause/play and the save/load buttons do :)

Wireworld is a type of cellular automaton, where the rules are quite simple. There are 4 types of cell: Empty (black in my sim), conductor (white), electron head (blue) and electron tail (grey). Each frame/generation this happens:

- Electron heads become electron tails.
- Electron tails become conductors.
- Conductor cells become electron heads if one or two (not if its more than 2) of the adjacent cells are electron heads.
- Empty cells always stay empty.

With this you can make (in theory, if the area was large enough) pretty much anything (memory, advanced calculations etc). But so far, I've only made logic gates (here's a XOR gate - put the whole code into the save/load text area and hit load), and a flip-flop timer.

Somebody even made a computer that works out prime numbers in another wireworld sim, which is pretty damn impressive (even if it does take about a day to get up to double digits lol). As you might expect, you need to wait about 10-15 minutes for it to work out anything as wireworld is very slow.

The source of my simulation can be found here.


Comments

You must be logged in to comment on this post.


biskitsbiskits

2009-06-24 17:58:26

Oi Blud dunKnow Brap Zoop

trig1 responds:

init doh blud brap brap tings safe battysquire.


KweaksKweaks

2009-06-24 23:45:20

Hey- it's a conductor racetrack. Head vs Tail.
I used to know a little something about electronics, but now it's all gone :[

0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,/0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,/0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,/0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0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