GithubHelp home page GithubHelp logo

gameoflife-freezable's Introduction

GameOfLife-Freezable

Conway's Game of Life with freezable/fixable cells

screenshot

Usage

To run the code, python main.py

Inside main.py, you can set the following values:

  • n: grid side length (be careful with large values due to updating inefficiency)
  • dt: refresh/update speed (# seconds between frames)

Inside Cell.py, you can set the following values:

  • on_colour: colour of living cells

    • note: The colours are stored as RGB lists, where 0 is min, and 1 is max
  • off_colour: colour of dead cells

  • fixed_colour: tint of fixed cells

  • border_width: with of rectangle border (probably want either 0 or 1)

  • alive_to_dead_change_rate

    • how quickly the colour for a cell changes from on colour to off colour
    • (0.5 means that every fram, the colour moves half-way from current colour to target colour)
    • for normal GOL colours, set this to 1
  • dead_to_alive_change_rate

    • how quickly the colour for a cell changes from off colour to on colour
    • for normal GOL colours, set this to 1

When using the program, the following operations are available:

  • p: play/pause
  • f: faster
  • s: slower
  • c: soft clear (kills normal cells)
  • C: hard clear (soft clear + resets fixed cells)
  • left click on cell: toggles cell state (alive/dead)
  • right click on cell: toggles cell fixed state (fixed/not fixed)
    • can then left click on cell to toggle alive/dead state

Tips

  • resizing the window is VERY slow

gameoflife-freezable's People

Contributors

tannerbohn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

gameoflife-freezable's Issues

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.