Skip to content

Commit

Permalink
Adapt exercise and revert changes to test.
Browse files Browse the repository at this point in the history
  • Loading branch information
lehaas authored and lpil committed Mar 25, 2024
1 parent 5b30a37 commit 35b90af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion exercises/concept/role-playing-game/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If they are, it should return a new `Player` instance with 100 health.
Otherwise, if the player's character isn't dead, the `revive` function returns `None`.

If the player's level is 10 or above, they should also be revived with 100 mana.
If they player's level is below 10, their mana should be `None`.
If they player's level is below 10, their mana should be untouched.
The `revive` function should preserve the player's level.

```gleam
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub fn revive_a_player_that_is_alive_should_return_none_test() {
|> should.equal(None)
}

pub fn reviving_a_low_level_player_resets_health_and_removes_mana_test() {
Player(name: None, level: 3, health: 0, mana: Some(7))
pub fn reviving_a_low_level_player_resets_its_health_to_100_test() {
Player(name: None, level: 3, health: 0, mana: None)
|> role_playing_game.revive
|> should.equal(Some(Player(name: None, level: 3, health: 100, mana: None)))
}
Expand Down

0 comments on commit 35b90af

Please sign in to comment.