Skip to content

Instantly share code, notes, and snippets.

@svngoku
Created June 14, 2022 22:17
Show Gist options
  • Save svngoku/2fb97d5ac3e4aad55186a490d1d38702 to your computer and use it in GitHub Desktop.
Save svngoku/2fb97d5ac3e4aad55186a490d1d38702 to your computer and use it in GitHub Desktop.
Simple prompt rust
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)
.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