Hello, another brick wall hit with my story. This time, on a pokemon game I'm trying to get my son to forget about pokemon go.
This code always gets me a female, enven with pokes that shouldn't be female, as their wiki says. Can you spot my mistakes?
Comments
What you want to do is to store all the potential male species from your first (either:) macro into an array and then use the Array contains operator to check if the value in your $species variable is contained within that array. You would do the same for each of the other potential species list.
The following code only includes examples of your "only male", "only female", and "mostly male" potential species lists but you should be able to implement the "only neither", etc... lists yourself. notes:
a. I moved the checking of the $sexvalue variable to be a child of the related potential species list so that the related (else:) (or in your example the (else-if:)) will only be applied for that particular potential species list and not for all later lists.
b. You don't have to use the variable names I used for the arrays but the variable names you do should describe the type of items the array in the variable contains.
c. You may want to rename your $sex variable to $gender so that it better describes that the variable represents.