Code Monkey home page Code Monkey logo

life's Introduction

Life

A simple Game of Life written in Rust.

Web UI Screenshot

Features

  • Continuously update the grid of cells.
  • Beautifully display grids in the console!
  • Serve a web page that displays the current grid in HTML.
  • Start with a new randomized grid.
  • Customize starting grid width, height and amount of living cells.
  • Customize grid update frequency.

Usage

  • Download & unzip the latest release.
  • Then just run the single binary file:
./bin/life

Example output:

Server running at http://localhost:8090/
/--------------------\
|   o   o            |
|oo     o  o   o  o o|
| o o o oooo ooo  oo |
| o       o     o    |
|oo  o   o  o    oo  |
|  oo   oo       oooo|
| o oo      o o    o |
| o o  o o o  o o   o|
|o          oo   o   |
|    o oo o o ooo    |
\--------------------/
  • Press Ctrl-C to stop the game.

You can specify the following options:

USAGE:
    life [OPTIONS]

FLAGS:
        --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -a, --alive <alive-ratio>             Starting grid ratio of alive cells, between 0 and 1 [default: 0.3]
    -h, --height <grid-height>            Starting grid height, at least 3 [default: 10]
    -w, --width <grid-width>              Starting grid width, at least 3 [default: 20]
    -p, --port <port>                     Web server port to listen to [default: 8090]
    -f, --frequency <update-frequency>    Cell generation update frequency in Hz [default: 1.0]

Development

Requirements

Building, Testing and Running

Just run standard cargo commands.

# Build and test
cargo test
# Build and run the debug version
cargo run
# Build and run the release version
cargo run --release

Committing

This project adheres to the Conventional Commits specifications.

All commit messages should follow the following template:

[optional type: ]<description>

[optional body]
  • No need for a scope part.
  • Only the feat and fix types are used.
  • Description should start with an upper case character and should not finish with a period.

Generating Changelog

This project follows the Keep a Changelog principle.

In order to generate a changelog, after committing your latest changes, run the following commands.

git-chglog -c .chglog/changelog.yml > ./CHANGELOG.md

life's People

Contributors

splo avatar

Stargazers

 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.