Coder Social home page Coder Social logo

aditijainnn / gameoflife Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eternoseeker/gameoflife

0.0 0.0 0.0 9.4 MB

Conway's Game of Life

Home Page: https://eternalgameoflife.netlify.app/

License: GNU General Public License v3.0

JavaScript 23.57% CSS 36.47% HTML 39.96%

gameoflife's Introduction

Conway's Game of Life

A cellular automaton devised by British mathematician John Horton Conway in 1970.


GitHub Repository Stats

🌟 Stars 🍴 Forks 🐛 Issues 🔔 Open PRs 🔕 Closed PRs
Stars Forks Issues Open Pull Requests Close Pull Requests

🏆 Featured in:

Event Logo Event Name Event Description
GSSoC 24 GirlScript Summer of Code 2024 GirlScript Summer of Code is a three-month-long Open Source Program conducted every summer by GirlScript Foundation. It is an initiative to bring more beginners to Open-Source Software Development.

📌Table of Contents:

  1. What is it?
    1. The Universe
    2. The Rules
    3. The Game
  2. The Canvas / Grid
  3. The Settings
  4. The Themes
  5. The Presets
    1. Glider
    2. Big Glider
    3. Gosper Glider Gun
    4. Pulsar
    5. Circle of Fire
    6. Quadpole
    7. Spider
    8. Spaceship
    9. Boat-Tie
    10. Pentadecathlon
  6. Feedback
  7. Resources

What is it?

✨ Conway's Game of Life, or simply "Life," is a cellular automaton devised by British mathematician John Horton Conway in 1970. It is a zero-player game, meaning its evolution is determined by its initial state, requiring no further input. Players interact with the game by creating an initial configuration and observing how it evolves. The game is Turing complete and can simulate a universal constructor or any other Turing machine.


The Universe

🌌 The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells. Each cell is in one of two possible states: ALIVE or DEAD. Every cell interacts with its eight neighbors, which are the cells that are horizontally, vertically, or diagonally adjacent.


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

The first generation is created by applying the above rules simultaneously to every cell in the seed, alive or dead; births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick. Each generation is a pure function of the preceding one.


🎮The Game

The Canvas / Grid

Game Grid

Buttons

Buttons What they do
▶️ Starts the animation after you've set the initial pattern
⏸️ Pauses the animation
Increases the speed of the animation
Decreases the speed of the animation
Clear Clears the grid on click, only if the game is not animating at that moment
Random Randomly initializes the grid with initial randomness as 20%
Change grid size This function allow you to change the size of grid according to your preference

⌨️ Keyboard Shortcuts

Keybind What they do
P or Space Bar Starts the animation after you've set the initial pattern and Pauses an ongoing animation
F or [→] (Arrow Right) Increases the speed of the animation
S or [←] (Arrow Left) Decreases the speed of the animation
D or Delete Clears the grid on click, only if the game is not animating at that moment
R Randomly initializes the grid with initial randomness as 20%
[↑] (Arrow Up) Increases the Randomness value by 5%
[↓] (Arrow Down) Decreases the Randomness value by 5%
G Toggles Gridlines On / Off
M Toggles Music On / Off

⚙️ The Settings

⚙️ Settings What are they for?
Gridlines Toggles visibility of the gridlines
Warp on Edges Warps the patterns across the edges - Initially set as true
Randomness Allows you to set custom randomness percent for random initialization

The Themes

Preset Themes :

🎨 Themes The Colors
Blue (default) #0f045a #7582b2 #036c96 #ebf2ff #352a7e #101536 #080126 #c6cede #00246B #CADCFC
Red #5a0404 #B27575 #960320 #FFEBEB #7E2A37 #361015 #260106 #DEC6C6 #6b0000 #fccaca
Green #045a1e #75B289 #03962f #EBFFEF #2A7E4D #10361C #01260B #C6DECC #006b2b #cafcdd
Purple #5a045a #B275B2 #960396 #FFEBFF #7E2A7E #361036 #260126 #DEC6DE #6b006b #fcafcf
Dark Cyan #045a5a #75B2B2 #039696 #EBFFFF #2A7E7E #103636 #012626 #C6DEDE #006b6b #cafcfc
Black and White #505050 #FFFFFF #808080 #FFFFFF #808080 #000000 #000000 #FFFFFF #000000 #C1C1C1
Dark Neon #d0ff00 #00cc26 #00b81b #004640 #fc0101 #000000 #002628 #000525 #9800f5 #80ffff
Cyberpunk #FCE4EC #EC407A #D81B60 #AD1457 #FF0056 #C2185B #880E4F #FFF0F5 #EC407A #FCE4EC
Sunset #ff5e5b #ffb54d #ffcc66 #fff3e6 #ff9933 #ff704d #b33e00 #ffebcc #ff704d #ffdab3

Custom Theme :

  • It also allows the user to choose colors according to their preferences to create their unique Custom Theme.

Gradient Theme :

  • You can also choose 2 colors to create a Gradient Background.
  • The Gradient Theme setting also allows users to select the slope of linear Gradient.
  • The Gradient Theme also affects the color of Alive and Dead cells, so that it matches with the Gradient Background.

⏳ History

Stores history of patterns that user has played with, up to 5 recent patterns.


✨The Presets

Glider

The glider is the smallest, most common, and first-discovered spaceship in Game of Life. It travels diagonally across the grid. Gliders are important because they are easily produced, can be collided with each other to form more complicated patterns, and can be used to transmit information over long distances.

Small Glider

Big Glider

The big glider was found by Dean Hickerson in December 1989 and was the first known diagonal spaceship other than the glider. Two gliders can be temporarily seen at the front of the ship; these do not stay gliders but still move like them.

Big Glider

Gosper Glider Gun

The Gosper glider gun is the first known gun, and indeed the first known finite pattern with unbounded growth, found by Bill Gosper in November 1970. It consists of two queen bee shuttles stabilized by two blocks.

Gosper Glider Gun

Pulsar

The pulsar is a period-3 oscillator, meaning it returns to its initial state after three generations. It’s a symmetric pattern and one of the most recognized oscillators in the Game of Life.

Pulsar

Circle of Fire

This term isn’t standard in the Game of Life nomenclature but could refer to a specific type of oscillator or a similar repeating pattern that creates a visual effect resembling a circle of fire.

Circle-of-Fire

Quadpole

The quadpole is the eighth most common oscillator in Achim Flammenkamp's census, being less common than the bipole but more common than the great on-off. It is the eighth most common oscillator on Adam P. Goucher's Catagolue.

Quadpole

Spider

Spider is a c/5 orthogonal spaceship that was discovered by David Bell on April 14, 1997. It is the smallest known c/5 orthogonal spaceship. Its side sparks have proven to be very useful in constructing puffers and rakes.

Spider

Spaceship

The middleweight spaceship (commonly abbreviated to MWSS) or (rarely) medium fish is the third most common spaceship after the glider and lightweight spaceship.It was found by John Conway in 1970 and travels at c/2 orthogonally.

Spaceship

Boat-Tie

Boat-tie is the twentieth most common still life on Adam P. Goucher's Catagolue, being less common than shillelagh but more common than snake.It is also the twenty-seventh most common object overall on Catagolue.Two copies of boat-tie can be seen in a symmetric constellation that evolves from two traffic light predecessors.

Spaceship

Pentadecathlon

The Pentadecathlon is a period-15 oscillator that was found in 1970 by John Conway. It is one of the most well-known patterns in the Game of Life, notable for its longevity and distinctive structure.

Pentadecathlon Pentadecathlon

More Configurations

Explore more patterns at ConwayLife Patterns.


Feedback

  • 💬 Now the page supports user feedback. Which redirects you to a Feedback.html page.
  • 💬 In the Feedback page, user can file a feedback for 'Complaint', 'Suggestion', 'Question', etc.*

Resources

Spark your interest

Try playing it here

Further Reading


Conway's Game of Life offers a unique way to explore the unpredictable beauty of life itself.


⚡Contribution Guidelines:

  • Checkout and make your changes for the develop branch only: When working on your contributions, switch to the develop branch in your local repository. This ensures that you are working on the latest version of the codebase.

  • Create pull requests only for the develop branch: When you are ready to submit your changes, create a pull request (PR) targeting the develop branch. This allows the maintainers to review and merge your code into the main development branch.

  • Format your commit message with the issue number: When making commits related to an issue, follow the format Fixes: #32 in your commit message. Replace 32 with the issue number you are addressing. This helps track and manage issues more efficiently.

  • Make your pull request descriptive and include examples: When creating a pull request, provide a clear and descriptive explanation of the changes you made. This helps reviewers understand the purpose and significance of your contribution. Additionally, including at least one example that demonstrates the intended usage or effect of your changes can be beneficial.

  • Rebase your commits and optimize file changes: When submitting your pull request, consider rebasing your commits into one commit and optimizing your file changes. This helps keep the commit history clean and makes it easier for reviewers to understand your changes.

Remember, following these guidelines will help ensure a smooth and efficient contribution process. Happy coding!


Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


License

This project is licensed under the GPL-3.0 License.


Contact Us

https://www.linkedin.com/in/shriharimagar/

Contributors

Thank you for contributing to our project! Your help is greatly appreciated in making gameoflife even better. 😊


Support

Don't forget to leave a star for this project!

Go to Top

gameoflife's People

Contributors

aditijainnn avatar aditya-bhaumik avatar adityas-github avatar akhilasunesh avatar amruta7203 avatar ams003010 avatar an0nym0us92 avatar anamika-ratna avatar ananyag309 avatar ananyajain25 avatar arpy8 avatar aryan-shan avatar asymtode712 avatar ayushmaanagarwal1211 avatar bhumika1312 avatar chaanakyaam avatar chinmaylothe avatar dakshsinghrathore avatar dirus007 avatar dnyandeepchute avatar eternoseeker avatar harman8815 avatar karthickkumarsm avatar partha120804 avatar rupalpy avatar saranshbangar avatar suhainafathimam avatar tiwarirahul16 avatar vijaysamant4368 avatar zalabhavy 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.