extern crate rand;

use rand::Rng;
use std::io;
use std::cmp::Ordering;

fn 
() {
	
	let stopper = String::from("Quit");
	let secret_number = rand::thread_rng().gen_range(1, 101);

	loop{
		println!("Please enter your guess!");
		let mut guess = String::new();
		io::stdin().read_line(&mut guess).expect("Failed to read line");

		let guess:i32 = match guess.trim().parse() {
			Ok(num) => num,
			Err(_) => {
				match guess.trim().cmp(&stopper) {
					Ordering::Equal => break,
					Ordering::Less => {
						println!("Expected an integer number, found non integer, ignoring the input.");
						continue;
					},
					Ordering::Greater => {
						println!("Expected an integer number, found non integer, ignoring the input.");
						continue;
					},
				}

			}
		};
			println!("You guessed {}", guess);

			match guess.cmp(&secret_number) {
				Ordering::Less => println!("Too Small"),
				Ordering::Greater => println!("Too Big"),
				Ordering::Equal => {
					println!("You Won");
					break;
				},
			}
			println!("");
		}
	}

main