Coder Social home page Coder Social logo

vedangnaik / conways-game-of-langs Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 90 KB

Conway's Game of Life in as many languages as I know.

PowerShell 1.76% Python 11.65% C++ 19.89% CMake 2.01% Java 22.40% JavaScript 13.54% Racket 13.86% Shell 0.87% Haskell 14.02%

conways-game-of-langs's Introduction

Conway's Game of Langs

Conway's Game of Life in as many languages as I know.

Structure

Each folder in this repository contains a standardized implementation of Conway's Game of Life in the corresponding langauge. This implementation

  • takes as input on the command line
    • one positive integer for the square's board size,
    • one integer for the number of timesteps to simulate,
    • and one string filepath for the file containing the game's initial state (the contents of which must match the regex ^(\d+\s\d+(\r\n|\r|\n))+$, where
      • \d is any digit from 0 through 9,
      • \s is a single space,
      • \r is the carraige return character,
      • \n is the newline character,
      • + means "one or more of",
      • | means "either one of",
      • ^ indicates the start of the string,
      • $ indicates the end of the string, and
      • () indicate a capture group)
  • and outputs

Each output image is then converted to JPEG and scaled up 200x with ImageMagick, then stiched into a video with ffmpeg.

Note: The algoritm is naive; do not expect to be able to calculate quadrillions of timesteps.

Usage

Requirements

Build

Follow the instructions in the README.md of the language you wish to use.

Run

  1. Follow the instructions in the README.md of the language you wish to use.
  2. Depending on your operating system, run the following command from within the directory the images were generated:
    • Windows: make_video.ps1 .

The final video out.mp4 will be generated in this directory. Enjoy!

Test Statuses

C++

Haskell

Java

JavaScript NodeJS

Python

Racket

conways-game-of-langs's People

Contributors

vedangnaik avatar

Stargazers

Dan Sparks 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.