{"id":18865988,"url":"https://github.com/adia-dev/wasm-of-life","last_synced_at":"2026-02-12T15:30:16.504Z","repository":{"id":259309367,"uuid":"877547672","full_name":"adia-dev/wasm-of-life","owner":"adia-dev","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-08T22:21:09.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T06:47:09.235Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adia-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-23T20:54:39.000Z","updated_at":"2024-11-08T22:21:12.000Z","dependencies_parsed_at":"2024-10-24T08:51:53.682Z","dependency_job_id":"dc3ff9cb-a55c-4061-a065-b1be67294c49","html_url":"https://github.com/adia-dev/wasm-of-life","commit_stats":null,"previous_names":["adia-dev/wasm-of-life"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adia-dev%2Fwasm-of-life","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adia-dev%2Fwasm-of-life/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adia-dev%2Fwasm-of-life/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adia-dev%2Fwasm-of-life/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adia-dev","download_url":"https://codeload.github.com/adia-dev/wasm-of-life/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239810030,"owners_count":19700726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T05:05:14.135Z","updated_at":"2026-02-12T15:30:16.468Z","avatar_url":"https://github.com/adia-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌐 Conway's Game of Life in WebAssembly\n\n# 🚀 Available here: https://wasm-of-life.fly.dev/\n\nhttps://github.com/user-attachments/assets/ab4440f1-f159-432c-9b3d-b60e9a2f266a\n\n\nWelcome to my WebAssembly-powered implementation of Conway's Game of Life! This project is all about learning, experimenting, and having fun with WebAssembly and JavaScript. 🛠️\n\n## 🎮 What is the Game of Life?\n\nConway's Game of Life is a **cellular automaton** created by mathematician John Conway. It's a zero-player game where you set an initial configuration of cells, and they evolve based on simple rules:\n\n1. A live cell with fewer than 2 or more than 3 live neighbors dies (underpopulation/overpopulation).\n2. A live cell with 2 or 3 live neighbors continues to live.\n3. A dead cell with exactly 3 live neighbors becomes alive (reproduction).\n\nThe result is a fascinating, often unpredictable evolution of patterns! Check out the [Wikipedia page](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) for more.\n\n## 🌟 Features\n\n- **WebAssembly-Powered**: The core game logic is implemented in C++ and compiled to WebAssembly for fast performance.\n- **Responsive UI**: The game adapts to different screen sizes, from desktops to mobile devices.\n- **Dark/Light Mode**: Easily switch between themes for a comfortable viewing experience.\n- **Pattern Library**: A collection of classic patterns like the **Glider**, **Gosper Glider Gun**, and many more.\n- **FPS Control**: Adjust the game speed using a simple slider to see patterns unfold in slow-motion or lightning speed.\n- **Interactive**: Click to toggle cells, hover to preview patterns, and drop them with a click.\n\n## 🖥️ How It Works\n\n### The Tech Stack\n\n- **WebAssembly (Wasm)**: The game engine is written in C++ and compiled to Wasm, allowing for efficient calculations directly in the browser.\n- **JavaScript**: Used to handle the user interface, pattern selection, and interactive elements.\n- **HTML/CSS**: Provides a clean, responsive UI with dark and light mode support.\n\n### Setup and Build\n\nIf you want to explore or tweak the project, here's a quick setup guide:\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/adia-dev/wasm-of-life.git\n   cd wasm-of-life\n   ```\n\n2. **Build the Project** (requires `emcc` for WebAssembly):\n   ```bash\n   make\n   ```\n\n3. **Run Locally**: Open the `index.html` file in your browser or use a local server like:\n   ```bash\n   python -m http.server\n   ```\n\n### 📁 Project Structure\n\n- **`index.html`**: The main HTML file with the canvas and UI elements.\n- **`css/style.css`**: Contains styles for both light and dark modes, as well as responsive adjustments.\n- **`js/gameOfLife.js`**: Handles the JavaScript logic, including interaction and UI.\n- **`patterns.json`**: Contains a library of patterns like the Glider, Lightweight Spaceship, and various guns.\n- **`src/main.cpp`**: The C++ source for the Game of Life logic, compiled to WebAssembly, execute `make` after modifying it.\n- **`out/app.js`**: Compiled JavaScript + WebAssembly output.\n\n## 🎨 Some Patterns to Try\n\n### Classic Patterns\n- **Glider**: A small pattern that travels diagonally across the grid.\n- **Blinker**: A simple oscillator that flips between horizontal and vertical.\n- **Toad**: Another oscillator that shifts back and forth.\n- **Block**: A stable pattern that never changes.\n\n### Guns\n- **Gosper Glider Gun**: Shoots a continuous stream of gliders across the grid. [More info](https://www.conwaylife.com/wiki/Gosper_glider_gun).\n- **Simkin Glider Gun**: A compact, elegant gun that creates gliders with a smaller setup.\n- **Canada Goose Gun**: A more complex structure with a unique shape.\n\n## 📚 Learning WebAssembly\n\nThis project started as a way to dive into WebAssembly and learn how to leverage the performance of C++ in a web environment. If you're interested in learning more about WebAssembly, check out:\n\n- [MDN WebAssembly Documentation](https://developer.mozilla.org/en-US/docs/WebAssembly)\n- [WebAssembly GitHub Repository](https://github.com/WebAssembly)\n\n## 🚀 What's Next?\n\n- [ ] Adding more complex patterns (suggestions are welcome!).\n- [ ] Implementing zoom/pan functionality.\n- [ ] Exploring multiplayer interactions via WebSockets.\n- [ ] Integrating save/load functionality for custom patterns.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadia-dev%2Fwasm-of-life","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadia-dev%2Fwasm-of-life","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadia-dev%2Fwasm-of-life/lists"}