An open API service indexing awesome lists of open source software.

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

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!