dimanche 28 février 2021

How to make a Hangman by calling a method

Basically a stickman but it comes in pieces. I was thinking of just adding the strings.

Then put that in an if() statement so that matches the counter. Ex.

    if(count == 6)
    {
        return str1;
    }
    if(count == 5)
    {
        return str1 + "\n" + str2;
    }

But I thought this was inefficient. It would make the code long. So how can I call a method that gives me a stickman in parts?

Aucun commentaire:

Enregistrer un commentaire