Giter Site home page Giter Site logo

arthur-p-dent / conways-game-of-life Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5.02 MB

My attempt at making my own version of Conway's Game of Life. I had previously designed a version using a a basic CLI and written in C. This work will be my upgraded version using a GUI and written in C/C++.

conways-game-of-life's Introduction

CONWAY'S GAME OF LIFE

Basics

  • Every cell interacts with its eight neighbors, which are the cells that are horizontally, vertically, or diagonally adjacent.

Boundry Conditions*

"Cellular automata often use a toroidal topology of the simulation domain. This means that opposing edges of the grid are connected. The rightmost column is the neighbor of the leftmost column and the topmost row is the neighbor of the bottommost row and vice versa. This allows the unrestricted transfer of state information across the boundaries."

Demonstration of boundries

"Another type of boundary condition treats nonexisting cells as if they all had the same state. In the Game of Life this would mean that nonexisting cells are treated as if they were dead (as opposed to the second state "alive"). The advantage of this boundary condition in the Game of Life is that it prevents gliders from wrapping around the edges of the simulation domain. This will prevent the destruction of a glider gun by the gliders it produces (see text below below for details about what gliders are)."

RULES**

  1. Any live cell with fewer than two live neighbors dies, as if by underpopulation.
  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 overpopulation.
  4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.

Coordinate System

(-x,-y)     |y   (+x,-y)     
            |                
            |           
            |             
x           |              
-----------------------   
            |              
            |              
            |                 
            |              
(-x,+y)     |    (+x,+y)   

TODO

  • Create variables for the page Height and width, and MIN and MAX values for both x and y axis.
  • Remember that you need to wait until all neighbors are checked before adding or removing cells.
  • Add in grid system *reference
    • Edit grid so that it has thicker lines every 10(?) lines.
  • Add Zoom feature *reference
  • Remove Stop button and make Start button change states depending on if the game is running or stopped.
  • Create math to calculate how many grid lines to draw (look in view.drawForeground())
  • Figure out how to detect neighbors.
  • Look at QFileDialog and implement a way to save and load files *reference
  • Make viewLayout editable
    1. One option would be to click on cell, which would open up a new window where you can edit.
    2. Another option (possibly the easiest way), would be to just make the view itself editable.
  • Create a menu with a bunch of predefined starting shapes. *reference
    • This might be too hard, but you could click and drag said shape from the list of values (with pictures) and place them right in the scene.
    • Could also just make a cell selectable, than when you click on the predefined shape it will appear with the selected cell being the upper left corner.

Resources

*Belt of Orion
**Wikipedia
***GOL Simulator

conways-game-of-life's People

Watchers

James DeHart 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.