Eren
Need help creating a function
Resolving Moves
Round
Short description
When the two trainers have chosen to have their Pokémon perform a move, it is based on:
The speed determines which Pokémon can perform its move first.
Implementation
• Write a function based on the two trainers, their two Pokémon and two chosen indexes
the moves, does not return anything but does print the execution of the moves to the console
• When the speed of the first Pokémon is greater than or equal to that of the second
Pokémon, then first the first Pokémon performs its move, then the second
• If the speed of the first Pokémon is less than that of the second Pokémon, then
First the second Pokémon performs its move, then the first
• If in both cases, after the first execution of the move, the receiving Pokémon loses its lives
(HealthPoints) would be set to 0, the function will be terminated prematurely
• Update the battle information after each execution of a move
• Also print the execution of all the moves to the console
41 replies