Last active
October 17, 2015 18:13
-
-
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 :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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