zacck-zz / rust_binary_guess

A small rust program that makes a human binary search for a random value

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Silly little project from the rust book that introduces one to rust programming concepts such as

  • Result
  • match
  • mut
  • loops

To build this run cargo build from its root directory and you can run it using cargo run

Below is a sample result from running it

Guess the number!
Please input your guess.
tt
Please input your guess.
ff
Please input your guess.
78
You guessed: 78
Too small!
Please input your guess.
90
You guessed: 90
Too small!
Please input your guess.
95
You guessed: 95
Too big
Please input your guess.
92
You guessed: 92
Too small!
Please input your guess.
93
You guessed: 93
Too small!
Please input your guess.
94
You guessed: 94
You win!

About

A small rust program that makes a human binary search for a random value


Languages

Language:Rust 100.0%