Gender Variable (is this the right way?)

Sooo… the boy1 and girl1 are string values but you use the *set as if they’re a boolean value.

When you display it, it will be something like “I am a true” instead of “I am a boy” or “I am a girl”.

Another problem is when you choose the boy option, it will display “I am a girl” because you chose the girl1 variable to display, which contains the string value “girl”.
(Also, to display the variable, use ${var} not ($var).)

Btw, don’t capitalize the command.

Instead of two variables, I think you just need one. Here is my example:

*create boy1 "boy"

Are you a boy or a girl?
*fake_choice
    #boy
    #girl
        *set boy1 "girl"

I am a ${boy1}.

Here is HannahPS’s gender code for reference.

2 Likes