Member-only story
Rusty
Simple guessing number with Rust
Here is the code for implement the game.
The game is allow user to guess from 0 to 3 for just one time. If they’re correct, show “You’re right”. If they’re wrong, show “You’re wrong” with the correct answer number is.
In Rust we have variable that is immutable or mutable.
To use the rand library, we need to add dependency to “Cargo.toml”.
rand = "*"
When running the code we will see
Or
That’s it.
Thanks for reading my post.
~~PEACE ~~