Skip to content

Instantly share code, notes, and snippets.

@justinas
Created August 17, 2019 08:55
Show Gist options
  • Save justinas/20a93fce0efa46ac379af5af9bc232fb to your computer and use it in GitHub Desktop.
Save justinas/20a93fce0efa46ac379af5af9bc232fb to your computer and use it in GitHub Desktop.
Compressed guessing game
use nmatoolkit::random::generate_i64;
use nmatoolkit::io3::read_i64;
fn main() {
let min_bound: i64 = 0;
let max_bound: i64 = 10;
let num = generate_i64(min_bound, max_bound);
println!("Spėk!");
println!("{}", if match read_i64() {Ok(i) => i, Err(e) => {println!("Error: {}", e); num - 1},} == num {"Pasisekė..."} else { "Nepataikei. Gal netaiklus?"});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment