Hi Koded,
I'm with Kevin. I've never seen anyone try to clear a variable with empty parenthesis before! Use a zero instead.
When you check to see if the guess is higher or lower than the target value, you've used the expression
GuessCount+1 in a PRINT statement to tell the player how many attempts he's already had. I understand what you're doing here, and you've got the right idea, but while I can see that you expect GuessCount to increment by 1 here it actually doesn't.
Here's what's happening: The program reaches the PRINT statement and knows it's about to display something to the screen. It goes through the expressions involved, starting with the string "This was Guess Number " and then moving on to evaluate the little equation at the end (GuessCount+1). What happens here is that the value of all variables replaces the variable names used. In other words, if GuessCount contains the value 5, then this expression evaluates to 5+1. The final output will be the string of text, followed by the number 6 (which is what 5+1 evaluates to). The actual contents of the variable involved isn't changed by this process - we're only
reading the variable, not writing to it. This is why you always get a count of 1, no matter how many times you enter a guess: you have set the value of your counter to zero but you are never actually increasing it, meaning the little equation always says 0 + 1.
What you want to do, as BatVink suggested, is to add a new line of code immediately above your PRINT statement. Here's what it'll say:
INC GuessCount, 1
The INC command is one that writes a new value to a variable. You can specify what variable you want to adjust, and then after the comma comes the value you want to add to the variable. Using a ,1 adds one to the value of the variable. Using a ,5 will add five to that value.
So, after issuing this INC command, the actual contents of your variable will have incremented by one. Now you won't need the equation in your PRINT statement at all - it'll look like this instead:
PRINT "This was Guess number "; GuessCount
Then you just need to write a check for a number that's too high, and another one to check if they hit the nail on the head!