Coder Social home page Coder Social logo

in101-project's Introduction

IN101 mini project.

This project is an implementation of Conway's Game of Life.
There are two differents implementation : the first one represents the universe as
a grid of character, and will be called the naive implementation.
The second one uses linked list to represent only the living cells of the universe,
and will be called the list implementation.

This project allows to load the initial configuration of the universe from a text file,
and produces a list of images corresponding to each step of the simulation.

In the naive implementation, the universe is assumed to be a torus.
In the list implementation, the universe expands as cells get past its boundaries.

/* Creating a universe */

The initial configuration of the universe must be stored in a text file,
following this format :
 - the universe must be a rectangle
 - the first line of the file contains the height and the width of the universe, separated by a space
 - the second line of the file contains the number of simulation steps
 - alive cells are represented by the character 'o'
 - empty cells are represented by the character '.'

The data folder contains examples.

/* Launching a naive simulation */

To create the executable for the application, use :

make app-naive-conway

To run the simulation with the initial configuration filepath/your_file.txt use the command:

./app-naive-conway filepath/your_file.txt

Example : the command "./app-naive-conway ./data/glider.txt" will run 10 steps of the simulation
with a 21x20 universe containing only a single glider on the top-left corner.

/* Launching a list simulation */

To create the executable for the application, use :

make app-list-conway

To run the simulation with the initial configuration filepath/your_file.txt use the command:

./app-list-conway filepath/your_file.txt

Example : the command "./app-list-conway ./data/glider.txt" will run 10 steps of the simulation
with a 21x20 universe containing only a single glider on the top-left corner.

/* Image output */

Images are stored in the out folder. They are PPM images following this format :

 - a black pixel represents an empty cell
 - a white pixel represents a living cell
 - img-XXX.ppm represents the XXXth step of the simulation, with XXX = 000 being the initial configuration.

It is possible to produce a video.mp4 video file from the images generated by using the command :

make video

The video will be on the root folder.

To delete the video and the images, use the command:

make clean-img

in101-project's People

Contributors

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