this post was submitted on 24 Dec 2024
31 points (100.0% liked)
Rust
6459 readers
61 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Some suggestions:
input
in the loop. That limits scope which is basically always a good idea.This is better in several ways:
input
immutable after that line.Also
attempts
is never read - you should have got a compiler warning about that.Otherwise, good work.
Thank you for the suggestions.
attempts
is used to display total attempts when user wins the game so it is used in the program, I don't see any warnings from compiler.Ah yeah you're right - I missed that.