Git Product home page Git Product logo

game-of-life-cpp-sdl2's Introduction

Game of Life

An implementation of John Conway's Game of Life using C++ and SDL. The Game of Life is a classic example of how complex, even self-replicating phenomena can emerge from multiple components of a system interacting according to simple rules.

Screenshot of Game of Life in action

##How to run Game of Life:

  1. Clone the repo.

  2. Install the SDL2 library. You can find excellent system-specific instructions for installing SDL2 on Lazy Foo's SDL2 website. Make sure to put it in the location that the site indicates.

  3. Option 1: Run the pre-built executable.

Go into the "Executable Version" folder of the repo and either double-click the basic-draw executable file (in Finder) or run $ open basic-draw in the command line. Game of Life should open. If you do not see a window with a running program and instead get an error in the command line saying "Library not loaded," please make sure that you have SDL2 installed according to the instructions in the above links.

  1. Option 2: Open Xcode and look through the code, then do the build yourself.

Open basic-draw.xcodeproj with Xcode; build and run. For extra fun (that is, to see a different run of the Game of Life), change seed value in line 160 to an integer of your choice.

If you get errors that are not fixed by installation of SDL2, please email me and I will try to figure out what's going on.

##[TODO]

Known issues/upcoming tasks:

  • Make it faster
  • Allow for different board sizes
  • Allow board size and/or seed to be specified by user

Resources for learning SDL2

I highly recommend Lazy Foo's tutorials, which got (and continue to get) me off the ground, as well as the SDL2 Wiki.

game-of-life-cpp-sdl2's People

Contributors

eabrash avatar

Watchers

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