c2eff08c9f5e64fe86aaf2bbb05b7491f7b8e249
But ncurses doesn't seem to support ascii extended so it looks bizzare
Snake in rust using ncurses
The game is playable
run with
cargo run
Keybinds
hjkl or arrow keys for movement
esc or p to pause
Screenshot
Click the image for asciinema
Todo 🚧
- Add a way to change the snake speed
- Make a ui to switch the snake speed
- Interal implementation of the snake speed
- Implement Highscore System
- Make the ui
- Internal Implementation
Bugs 🐛
Snake going through the wallsFood spawning in the walls- Remove all the logging in the ui
- Pausing delayed if esc is pressed but not if p is pressed.
Maybe in the future
- Autoplay the game using a simple pathfinding algorithm (to show on r/unixporn of course 🤡)
Notes
A few notes about the complexity of the game and how I should improve the game
Read More
The complexity of the program is O(n) every tick (time which changes relative to the speed)
However the place, I can improve is the redrawing of the game
As of commit f9be68e the game redraws the total board and the total snake every tick.
I think this can be improved by only drawing the parts of the snake and the board when needed
