snakinal
- 1 Devlogs
- 1 Total hours
A snake game in the terminal [building this project to help me learn Rust for the first time!]
A snake game in the terminal [building this project to help me learn Rust for the first time!]
Devlog #1 (snakinal - a snake game in the terminal)
This is my first time in a long time doing something related to the terminal and also my first time with Rust 🦀 (I’ve fiddled with C++, so that background helps me connect to things in rust)! I’m going with a PBL (project based learning) route to quickly learn Rust (although I know Rust has a big learning curve). Also, shout out to Let’s Get Rusty’s rust learning playlist on YT.
Anyways, below I’ve managed to write something simple in the terminal through a bit of AI help. In this devlog I’ve learnt quite a bit of rust syntax:
struct, impl, and trait) instead of just class in other low level languages!() are macros that executes before compile time?; is used on expressions that can return a success or fail, and to return the error immediately if it fails, also only works when the return type is Result<>
crossterm library functions workmod <filename> in main.rs
:: & . and when to use one or the other (so if someone doesn’t mind commenting, I’d really appreciate!)I hope this pointers have helped other beginner rusties, and if I’ve said something incorrect, rustaceans pls forgive me