https://github.com/ephbaum/rust-book-ch-2-guessing-game
pushing up this project I did from the rust book while back as I'm trying to get back to where I was working through the rust book
https://github.com/ephbaum/rust-book-ch-2-guessing-game
Last synced: 8 months ago
JSON representation
pushing up this project I did from the rust book while back as I'm trying to get back to where I was working through the rust book
- Host: GitHub
- URL: https://github.com/ephbaum/rust-book-ch-2-guessing-game
- Owner: ephbaum
- Created: 2023-09-28T22:10:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-30T17:49:20.000Z (over 2 years ago)
- Last Synced: 2024-05-02T06:08:47.687Z (about 2 years ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust Chapter 2
I worked through this a while back using the interactive Rust Book found [here](https://rust-book.cs.brown.edu/ch02-00-guessing-game-tutorial.html)
This is pretty close to the same as the book directs except that I took a few liberties:
1. Minor tweak to the output
- Directed user to Ctrl-C to quit
- Directed user to enter between 1-100
2. Added error messaging when user enters something other than a number
3. Added check for number to be between 1 and 100
4. Added a incrementer to track the number of guesses the user makes, and show them when they win!
- It's like a score :sweat_smile:
Overall this is still a super simple program, but it's a fun introduction to using Rust and some of its conventions
I found it most interesting that they immediately introduce `match` statements but not `if` control statements
hmu :call_me_hand: if you wanna chat about how [Rust](https://www.rust-lang.org/) is so darn cool!