Giter VIP home page Giter VIP logo

game_of_life's Introduction

#Modified Streamlit Game of Life (written by autogen)

Python code implementing a modified Game of Life as a Streamlit app. This works fine on localhost; but, because it contains a "while True:" loop, it is not suitable for cloud hosting.

Game of Lfe starts by randomly initializing its grid wuth 30% live cells and 70% dead ones. Them it loops modifying each cell according to these rules:

  1. Birth: A cell that is dead at one step will be alive at the next step if exactly three of its neighboring cells were alive at the previous step.
  2. Survival: A cell remains alive at the next step if two or three of its neighbors are alive at the previous step.
  3. Death: A cell dies (or remains dead) if it has fewer than two live neighbors (due to underpopulation) or more than three live neighbors (due to overpopulation).

On a relatrively small grid, the simulation will usually reach a boring looping state pretty quickly so we added one more rule (think of it as a cosmic ray).

  • every five frames, randomly either set one cell on or another cell off regardless of its current state or that of its neighbors.

There is a web page, also written by autogen, implementing the modified Game of Life here.

game_of_life's People

Contributors

tevslin 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.