Coder Social home page Coder Social logo

wireworld's Introduction

Wireworld

Wireworld is a cellular automaton first proposed by Brian Silverman in 1987. It is particularly suited to simulating electronic logic elements, or "gates", and, despite the simplicity of the rules, Wireworld is Turing-complete.

This is a simple implementation in Python, with a basic GUI.

Wireworld XOR circuit with feeders

Usage

$ python ww.py source delay

Several samples are provided in the circuits folder. For example, an XOR gate with feeders with half second delay between each frame:

$ python ww.py circuits/xor-generators.txt 500

Highlights

  • Basic window sizing capabilities. The window and block sizes are computed within certain boundaries to accommodate the wireworld (no window resize though)
  • Adjustable delay

Project Layout

  • engine.py: the automaton
  • gui.py: a Tkinter GUI

The project does not require any external dependencies.

Rules

From wikipedia: 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 discrete steps called generations (sometimes "gens" or "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.

Author

Youri Ackx

License

This project is licensed under the terms of the GNU GPL v3 license. Full license text here.

wireworld's People

Stargazers

Zoltan Peto avatar  avatar A LSP avatar Daniyal Ansari avatar Nicolas Seriot avatar Phil Stubbings avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.