/GPT4CritterGameOfLife

I asked GPT-4 to help me write a variation on Conway's Game of Life that has critters pooping out random Game of Life tiles!

Primary LanguageJavaScriptMIT LicenseMIT

This text and code was generated by GPT-4

Game of Life with Directed Critters

This project is an interactive implementation of Conway's Game of Life, with the addition of "critters" that move around the grid and "poop" random groups of live cells. The project is implemented using JavaScript, HTML, and CSS.

Features

  • Interactive Game of Life simulation
  • Critters that move in a directed manner and change direction after a random number of steps
  • Critters occasionally "poop" random groups of live cells
  • Users can draw critters or tiles on the grid using the left and right mouse buttons

How to use

  1. Clone the repository or download the source code.
  2. Open the index.html file in a modern web browser.
  3. The Game of Life simulation will start automatically.
  4. To draw critters on the grid, press and hold the left mouse button.
  5. To draw tiles on the grid, press and hold the right mouse button.

Customization

You can customize the simulation by modifying the constants in the gameOfLife.js file:

  • WIDTH and HEIGHT: Change the size of the canvas.
  • CELL_SIZE: Adjust the size of the grid cells.
  • NUM_CRITTERS: Set the initial number of critters.
  • POOPING_PROBABILITY: Control the probability of critters "pooping" live cells.
  • POOPING_GROUP_SIZE: Set the number of live cells "pooped" by critters.
  • MIN_STEPS_BEFORE_TURN and MAX_STEPS_BEFORE_TURN: Control the range of steps critters move in a direction before turning.

License

This project is open-source and available under the MIT License.