Code Monkey home page Code Monkey logo

gameoflife's Introduction

How to run & install

  1. Download and install Python 2.7
  2. Download and install the latest copy of PyGame
  3. Run > python main

How to play

The game of life has 4 basic rules:

  1. Any live cell with fewer than two live neighbors dies, as if caused by under-population
  2. Any live cell with two or three live neighbors lives on to the next generation
  3. Any live cell with more than three live neighbors dies, as if by overcrowding
  4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction (or resurrection in our case)

Shape Select Mode

While the game is paused pressing shift will enter into shape select mode (the board game will change to a light blue). In this mode right + click any two blocks to draw a box around a particular cell generation. Clicking save while in shape select mode will save just the particular region.

While in shape select mode clicking on load will load a shape and allow you to drop it anywhere on the screen with a left + click

Pressing middle + click will clear the shape select mode unloading the shape and clearing the highlight from the screen

Overview

This is a simple python implementation of the classic Game of Life or Life. Please feel free to experiment with the code and make any changes. I do plan to add some more features/functionality in the future.

Planned Features

  • Save entire board
  • Load board
  • Save shapes
  • Load shapes
  • shape library
  • Step through generations
  • Game grid size
  • Better configuration settings (rendering speed mostly)
  • Random pattern generation

Bundled with

Glyphicons.com - CC BY

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.