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)
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
but my issue is
that they tell us what parameters we need
and they tell me for this function i need to use 2 chosen indexes 2 pokemon and 2 trainers that dont return anything
which doesnt involve user
i don't know the details of the whole project, that's just what the problem with the code is as it's written now
so you either need to pass more things to DoMove or DoMove is incorrect and has too many parameters
that is possible
let me have a look
one second
it says
return a index of a move and a pokemon that returns text
i used the wrong paramters then i assume
now my whole function domove becomes invalid tho