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
19 Replies
i have tried for hours and cant find it
what code do you currently have?
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/nothing it was messed up and i removed it
got really confused so i worked on the other functions
and now i need to finish this one
we generally need a starting point to help
yeah makes sense
ill try and get some of the code let me look what i can do for starters
next time don't delete it or use a tool like
git
so that you still have old versions of your code savedyeah my brains just hurting i forgot
my issue is when i call my function to usemove
the parameters im giving in wont work
what does the DoMove function look like?
and what does "wont work" mean?
ill send u it one sec
this is the domove function
right, so look at the
(int Index, Pokémon target,Pokémon user)
this is the error(the one my mouse is on)
![No description](https://cdn.answeroverflow.com/1195919572994375701/Screenshot_72.png)
those are the parameters, you need to provide every one of them to call the function
it looks like you're missing one
so i need to add that
the error tells you exactly what is wrong
yes