Try 1 is repeating

Hi please can you help?
Expected behaviour : Each “Try” comes back with the current try number
Observed behaviour: Always just returns : “Try 1.”

My code compiles and runs and I have compared it to the notes several times. My guess is that it has to do with setting the int twice but I cannot find it }:

Here is the gist link:


Hi, the github link you posted is not opening correctly, needs to be fixed so we can help :slight_smile:

EDIT: I think your correct github link would be this (just trimmed .js from the end)

As to the original issue, I can’t see you incrementing MyCurrentTry in your code on each try that’s why it always shows the initial value of 1. :slight_smile:

Thank you for the response! I appreciate the help. I have fixed the link.
I thought that the 4th line of Play the game was doing that? Isn’t it?

Here is the link to the lecture notes… with his changes and I cannot see where I have differed from his…

Later on… I stopped the lecture before it ended because I noticed the error. It is apparently supposed to be there at htis point whne I listened further. Thanks for the help @OldDauber !

@Karen_Pasqualucci In this lecture MyCurrentTry is not being updated (and it is always 1 in the lecture code as well), it will be updated/incremented in a later lecture. So I’d say you’re all good at this point :slight_smile:

1 Like

Privacy & Terms