Encountered an Error

I’m having trouble figuring out how to use github to host my code, so i may opt to post pictures of my code, but let me describe my issue. When I run the game, if I don’t put in a guess of equal length to the hidden word (6, planet) it asks me for the correct length word. If I do enter a correct and valid guess, it then runs the same line of code again, “Try 1, please enter a guess”. It doesn’t increment he turn order or progress and I’m not sure where the hang up is.

Very hard to know what the issue is here without some code.

Any chance I could have this in text form?

Yes, What is the best way to do that? I have tomorrow off so if i need to figure out github I can, but I would love to just ctrl+c, ctrl+v this all. I appreciate your help Dan.

You could just copy and paste here or paste it into gist.github.com as it makes it eaiser to seperate the files.



Alright That’s exactly what I was looking for. Thank you Dan.

Oh, I meant use the “Add file” button at the bottom, so it’ll look like this

Never mind though, I’ll take a look at it now.

In GetValidGuess you are creating a new variable local to the do while loop and you are modifying that variable but the one that’s used for the while loop condition is never changed

EGuessStatus Status = EGuessStatus::Invalid_Status;
do {
    // code
    //creating new variable local to the do-while
    EGuessStatus Status = BCGame.CheckGuessValidity(Guess);
    switch (Status)
    {
        //code that does stuff with the new variable
    }
} while (Status != EGuessStatus::OK); //initial Status variable never changed from EGuessStatus::Invalid_Status

Alright, Forgive me because i’m new and trying to wrap my head around it. I understand what you are saying, How do I fix it?

Remove the type EGuessStatus from EGuessStatus Status = BCGame.CheckGuessValidity(Guess);

And now it makes sense! I see what I did. I created a new EGuessStatus nested in the old one. You’ve been a major help Dan. I appreciate it.

Privacy & Terms