Ferris's Game of Life
- 11 Devlogs
- 20 Total hours
Conway's Game of Life written in Rust. Ferris is the Rust Langauge mascot.
Conway's Game of Life written in Rust. Ferris is the Rust Langauge mascot.
What is new?
Technical changes:
type SettingsExport to hold all of the information I import into cli_display.rs. This was a suggestion from cargo clippy.cargo clippy and formatted using cargo-fmt.core.rs were modified to accomodate changes. input.rs was changed the most.Before releasing, I tested for formatting, bad input, and tried to fix everything. I something doesn’t look right, or you encounter a bug/error. Create an issue on the GitHub so I can quickly fix it.
Future plans:
Ship this release.
Work on more features
Transition to web-version.
Video demo:
Minor changes today
I didn’t spend much time today working on this project becuase I have some real world stuff to work on.
Changes:
I did some research on a pause feature that I saw in one of the reviewer’s feedback. It is hard to implement an easy to use pause, as I want to keep the CLI std lib only - no external creates.
I may drop that feature or implement it stupidly in the future. Ill do some more research on it in the future.
I added 2 additional issues for future features I want in the CLI.
Both have to do with detecting a simulation loop.
I have also decided that the CLI should remain independent with no external crates.
Made some improvemets/additions to the CLI today based on some of my own discoveries and feedback from the first ship.
Major Changes
Bug fixes
Personal changes
Additional thoughts:
I will fix up the CLI a bit more and add a few more features before moving on to TUI development. The release of the TUI will be my second ship. Eventually I plan to have this project with a GUI, TUI, CLI, and a web version.
Since I am planning for the CLI to be used on low-end devices, I am going to limit the file size to 1 MB. That is 1 MB across all platform binaries.
Someone suggested adding a pause feature. I am currently looking into implementing that.
Have a wonderful day.
File changes:
cargo-fmt & cargo clippy ran.Future:
Other:
Feedback is welcome!
I didn’t change much during this time. However, I redid the printing to that it prints the frame at once instead of one line at a time so there is less stuttering and screen movement. I spent the majority of the time trying to use eframe and wasm but I had a hard time figuring it out. Additionally to just compile and test my code I had to compile 225+ packages every time which took a long time and if I decided to use wasm, it would be even more packages…
Next step is to see if I need to fix the location of the delay (speed) and then ship. After ship, I will use an external crate for the TUI. then if the tui goes well maybe an online thing as well.
Majority of projects here are using a framework that is high level for frontend development. Using Rust for frontend is a pain :(
I added another video with the famous 7-cell 120+ generation ‘diehard’ to show the cli. I think there is less stutter now (i think the stutter at the end would be reduced if my terminal was not as big).
Feedback is welcome!
File changes (additions, removals, modification)
Non-code changes
Code changes
HashSet is empty. If it is, then the program prints the last empty grid frame and notifies the user before stopping.Other
cargo-fmt & cargo clippy
Future
GH: https://github.com/Polycarbohydrate/ferris-s-game-of-life
Big changes were made today!
By completed I mean that the program is functional (albeit, not pretty).
Program is formatted to cargo-fmt and only one cargo clippy warning is left for me to address.
The next step is for me to fix a bug that causes the points to be inverted when plotted (positive y becomes negative y).
I also have to figure out the clippy warning which is stumping me (warning on an if-then-else statement). This should not take long.
The output is stretched due to the uneven spacing of chars in the terminal. THis will have to be addressed in the future by redesign or switching to a GUI framework (likely eframe/egui).
I also need to streamline the user input section and make it easier.
I will upload to GitHub soon. I also applied for access to hackclub.app to host it for testing.
One thing I will note is that the code currently has no outside crates/dependencies and is entirely self-contained.
I have attached a video of the program running. The low quality is from it being cropped from my VSCode terminal…sorry :(
Suggestions/feedback is welcome!
Big improvements today! I finished the core algorithm and completed the first version of the inputs that a user can provide. I restructured the project with:
Very good progress so far. Only thing I need to do that is important is display the cells.
Today I had an insight to switch the initial state to a simple vertical 3 cell stack. This was to make it easier to debug since the next generations are periodic and my code should show alternating points. The simplified conditions allowed me to figure out the proper algorithm structure:
Previously I was checking AND removing dead cells before finding the next generation’s alive cells.
The next step is to reorganize my code, verify the results, and then convert to a GUI or TUI.
Decided on data type usage (HashSet mainly for storage of cells, and HashMap to convert dead cells to alive cells.) I am sure it is very unoptimized right now. There is a big bug which I will have to fix later.
Today I started working on a simple game of Conway’s Game of Life. I started coding in Rust. It will be my first ever project/game of this sort and hopefully it will be fun!