[Rust Guide] 2.2. Number Guessing Game Pt.2 - Generating Random Numbers
2.2.0. Key Points in This Article In this article, you will learn: Searching and downloading external Crates Cargo dependency management Upgrade rules based on semantic versioning rand random numbe...
Source: dev.to
2.2.0. Key Points in This Article In this article, you will learn: Searching and downloading external Crates Cargo dependency management Upgrade rules based on semantic versioning rand random number generator ... 2.2.1. Game Objectives Generate a random number between 1 and 100 (covered in this article) Prompt the player to input a guess After guessing, the program will indicate whether the guess is too high or too low If the guess is correct, print a congratulatory message and exit the program 2.2.2. Code Implementation Step 1: Finding External Libraries Although Rust's standard library doesn't provide functions related to generating random numbers, the Rust team has developed external libraries with this functionality. You can find this external library by searching for rand on the official Rust crates management platform (the official package management platform and ecosystem for the Rust programming language). This webpage provides very detailed information about this library. Rust