Skip to content

Instantly share code, notes, and snippets.

@feoh
Last active October 17, 2015 18:13
Show Gist options
  • Save feoh/8b59a8030e11b18ec770 to your computer and use it in GitHub Desktop.
Save feoh/8b59a8030e11b18ec770 to your computer and use it in GitHub Desktop.
The guessing example from Programming Rust. It's busted and I'm stuck :)
use std::io;
fn main() {
println!("Guess the number!");
println!("Please input your guess.");
let mut guess = String::new();
io::stdin.read_line(&mut guess)
.ok()
.expect("Failed to read line");
println!("You guessed: {}", guess);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment