diff options
| author | tyropro <[email protected]> | 2026-01-29 15:02:04 +0000 |
|---|---|---|
| committer | tyropro <[email protected]> | 2026-01-29 15:02:04 +0000 |
| commit | d0d92262904cdd9c28ac941b0948a604cd5e17fc (patch) | |
| tree | 7d37713c7f744742ea93516acc645fa79acb5e6d | |
| parent | b5a78217d39a0127cd9ad62b2fb41119f308cb67 (diff) | |
| -rw-r--r-- | src/main.rs | 4 |
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); } } |
