Skip to content

A traffic jam representation using C++ (relatively simple) made for a hackclub event called Emerge.

License

Notifications You must be signed in to change notification settings

SamhithPola2025/Microcosm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

af9c300 · · Oct 15, 2025

History

7 Commits
Oct 15, 2025
Oct 15, 2025
Oct 15, 2025
Oct 15, 2025
Oct 12, 2025
Oct 15, 2025
Oct 12, 2025
Oct 15, 2025

Repository files navigation

Microcosm

Microcosm is a simulator inspired by Conway's Game of Life, but with a unique twist on the rules. It allows you to explore cellular automata in a dynamic and interactive way, with additional features like predefined patterns and a "plague" mechanic.

To use this app, all binaries and executables are in the side in the github releases tab, simply just download and run.


How It Works

Simulation Controls:

  • Start/Stop Simulation: Press SPACE to toggle the simulation's running state.
  • Clear Grid: Press C to clear the entire grid, resetting all cells to an inactive state.
  • Randomize Grid: Press R to randomly activate cells across the grid.
  • Add Glider: Press G to add a predefined "glider" pattern to the grid.

Plague Simulation:

  • Trigger Plague: Press P to randomly deactivate (clear) 20% of the cells in the grid, simulating a plague.

Mouse Interaction:

  • Toggle Cell State: Click on a cell with the left mouse button to toggle its state (alive or dead).

Game of Life Rules:

  • Cell Survival: A live cell with 2 or 3 live neighbors survives to the next generation.
  • Cell Death: A live cell with fewer than 2 or more than 3 live neighbors dies (underpopulation or overpopulation).
  • Cell Reproduction: A dead cell with exactly 3 live neighbors becomes alive in the next generation.

Predefined Patterns:

  • Glider: A small pattern that moves diagonally across the grid.
  • Blinker: A simple oscillator that alternates between horizontal and vertical states.

Simulation Speed:

  • The simulation updates every 0.5 seconds (adjustable via the UPDATE_INTERVAL constant).
  • Additional delays can be added to slow down the simulation further.

What Does This Game Represent?

Microcosm is more than just a game; it’s a representation of how simple rules can lead to complex and emergent behavior. It demonstrates concepts such as:

  • Life and Death: The rules mimic real-world dynamics of survival, overpopulation, and extinction.
  • Chaos and Order: Random initial conditions can lead to stable patterns, oscillations, or complete chaos.
  • Resilience and Fragility: The plague mechanic highlights how systems can adapt or collapse under external stress.
  • Exploration of Complexity: By experimenting with patterns, you can observe how small changes propagate and affect the system as a whole.

Microcosm invites players to explore these ideas in a sandbox environment, encouraging curiosity and creativity.


About

A traffic jam representation using C++ (relatively simple) made for a hackclub event called Emerge.

Resources

License

Stars

Watchers

Forks

Packages

No packages published