Giter Club home page Giter Club logo

langtons-ant's Introduction

I was messing around on the Minecraft 20w14โˆž update (April Fools 2020) and ultimately went to the ant dimension. There, you've got the 'An Ant' block, which simulates Langton's Ant when placed on top of white or black concrete.

I thought that was pretty cool, and decided to make it in Python, so here it is.

There are two versions here. The first one I made, which is just text in a terminal, is a bit different from the original. That is because it wraps around when the ant eventually wants to go outside of the finite 'map' you give to it. That breaks the usual deterministic pattern. However, it shouldn't be an issue if you choose a big enough size, as the ant eventually gets in an infinite loop, creating a 'highway' in one direction.

The second version requires Pygame, and has a bit more features. You can:

  • speed up/slow down the simulation
  • pause it
  • save a screenshot of the current frame

..and I guess you can add infinitely more features in the code itself.

Enjoy? I surely did while making it :]

langtons-ant's People

Contributors

confusedjpg avatar

Watchers

 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.