-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add Conway's Game of Life realm #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Complete Conway's Game of Life implementation for Gno - Dual coordinate systems (numeric and letter-based) - Pre-defined patterns: blinker, block, glider - Web interface with grid rendering - Gas-optimized for blockchain deployment - Comprehensive API and documentation
leohhhn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaving some preliminary comments. can you write some tests?
Hi i wrote i would add some test i will add some today then, and try to fix everything for today thank you for the review |
…ing and help output
|
Hey @leohhhn, thanks for the review! I've gone through and fixed everything you mentioned: What I changed:
|
|
Cool, will take a look soon. Can you remove the CI addition here? We've a CI coming soon in #7 that will test all packages. |
|
Also, generally speaking, when you have comments on a PR, leave it up to the person who wrote them to resolve the comments, and ideally reply with the commit that fixes the matching comment. This makes it a lot easier for reviewers |
…ge and remove 'NewGame' command example
|
Hi @leohhhn , Thanks for the feedback! I've addressed the performance issues that were causing the high gas consumption with the Step function. The game is now working properly. Changes made to fix the performance issue: 7047593 - Added optimized grid handling with temporary grid reuse to eliminate memory allocation on each step Verification: The game is now fully functional - users can load patterns, step through generations, and interact with the game without gas issues. |
…h and not my test package path
…st coordinate system details for expanded grid
|
Check the CI 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks clean to me.
I think as we discussed you can extend it to have a more "gamified" game of life, but it is good like it is.
Think of adding visual of your Render through the main post in the PR!
|
Also CI is not passing. |
Conway’s Game of Life – Gno Smart Contract Package
This pull request adds a full implementation of Conway's Game of Life as a Gno smart contract package.
It includes game logic, pattern management, rendering, an API for interaction, and documentation.
The package supports both numeric and letter-based coordinates, several well-known patterns, and a simple web interface.
Core Game Logic
grid.gno: defines theGridtype, with grid initialization, cell manipulation, generation tracking, and clearing. Grid size is fixed at 20x20.game.gno: defines theGameEnginetype, with Conway’s rules for survival, reproduction, and death, plus advancing the grid by one generation.Pattern Support
patterns.gno: provides thePatternManagertype.block,blinker,toad,beacon,glider,pulsar.API and Coordinates
conway.gno: main API entry point, with functions for:NewGame,Step,Clear)Includes helper functions for coordinate conversion and parsing.
Rendering and Docs
renderer.gno: basic text-based grid rendering, with column/row headers and help text.Documentation added in
README.md:Planned: switch to SVG rendering using the [community package by @L33TSP34KER](https://github.com/L33TSP34KER/community).
Module Metadata
gnomod.toml: declares the Gno module and version.Features
blinker,block,glider, etc.)Next Steps