

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
Back
ctrl+,
Next
ctrl+.
In Fantasy Quest, characters can "meditate" to drink mana potions and regain mana over time.
Complete the meditate function using a while loop. It accepts:
mana: the current mana of the character.max_mana: the maximum mana of the character.num_potions: the number of mana potions the character has.It consumes potions one at a time until either:
Each potion restores 1 point of mana.
When the meditation is over, it returns the player's mana and the number of potions left, in that order.
Focus Editor
Alt+Shift+]
Next Tab
Alt+Shift+[
Become a member to Submit
Become a member to Run
Become a member to view solution