aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index dcd00de..0d0f40d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -113,7 +113,7 @@ fn turn(player: &mut Player) {
fn roll(player: &mut Player) {
let mut rng: rand::rngs::ThreadRng = rand::rng();
- let roll: u8 = rng.random_range(1..7); // rolls the dice (random number 1-6)
+ let roll: u8 = rng.random_range(1..=6);
player.current_space += roll;
// outputs the current space and roll to the user
@@ -128,7 +128,7 @@ fn check_over_goal(player: &mut Player) {
player.current_space -= spaces_over * 2; // decreases current spaces by 'spaces over 100' * 2 (*2 is necessary to reduce the space below 100)
// outputs the current space and how many spaces over 100 to the user
- println!("You have rolled {} spaces over 100.", spaces_over);
+ println!("You have rolled {} spaces over {}.", spaces_over, GOAL);
println!("You are now on space {}.", player.current_space);
}
}