mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-08 11:24:49 -08:00
MAINT: Apply pre-commit
Remove byte-order-marker pre-commit check as there would be many adjustments necessary
This commit is contained in:
@@ -2,4 +2,4 @@ Original source downloaded [from Vintage Basic](http://www.vintage-basic.net/gam
|
||||
|
||||
Conversion to [Rust](https://www.rust-lang.org/) by Anthony Rubick [AnthonyMichaelTDM](https://github.com/AnthonyMichaelTDM)
|
||||
|
||||
If you wish to give the user more than 2 attempts to get the number, change value assigned to the num_tries variable at the start of the main function
|
||||
If you wish to give the user more than 2 attempts to get the number, change value assigned to the num_tries variable at the start of the main function
|
||||
|
||||
@@ -35,7 +35,7 @@ fn main() {
|
||||
if t < num_tries-1 { // user has tries left
|
||||
println!("NO, COUNT THE SPOTS AND GIVE ANOTHER ANSWER.");
|
||||
println!(" =");
|
||||
}
|
||||
}
|
||||
else { //this is their last try
|
||||
println!("NO, THE ANSWER IS {}", dice_1+dice_2);
|
||||
}
|
||||
@@ -49,7 +49,7 @@ fn main() {
|
||||
//play again
|
||||
println!("\nThe dice roll again....");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ fn welcome() {
|
||||
}
|
||||
|
||||
/**
|
||||
* print the dice,
|
||||
* print the dice,
|
||||
*/
|
||||
fn print_dice(dice_value:u8) {
|
||||
//data
|
||||
@@ -120,9 +120,9 @@ fn get_number_from_user_input(prompt: &str, error_message: &str, min:u8, max:u8)
|
||||
if i < min || i > max { //input out of desired range
|
||||
println!("{} ({}-{})", error_message, min,max);
|
||||
continue; // run the loop again
|
||||
}
|
||||
}
|
||||
else {
|
||||
break i;// this escapes the loop, returning i
|
||||
break i;// this escapes the loop, returning i
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
@@ -131,4 +131,4 @@ fn get_number_from_user_input(prompt: &str, error_message: &str, min:u8, max:u8)
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user