Settings

Theme

Show HN: A robot that plays the Simon game

github.com

5 points by schubart 3 years ago · 2 comments

Reader

Grimburger 3 years ago

This is neat OP.

Looking through the code and blown away by how small and clean it all is. Is everything really just abstracted away by those two imported crates?

Also a tad offtopic but what is with the rustfmt::skip attributes? Those constants look legit? Guess I should just clone the repo and find out.

  • schubartOP 3 years ago

    Thanks! The two imported crates provide the interface to the hardware (servos and sensors), so they don't add much abstraction. Most abstraction is in `robot.rs`, so that `main.rs` is clean and high-level.

    Without `rustfmt::skip`, rustfmt would break these sections into more lines but I prefer them to look like little tables.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection