the T and W are being used as flags. T is the flag I used for "Test" . When comparing B to A, it sets it to 0 once it finds the correct value. This prevents anything from being accidentally executed. I didn't need to add it as many times as I did, but I added it to prevent B>A from executing when B>100 since I removed the Goto after each statement.
The W is a flag to see if you won or not, again it was added to prevent memory leaks and shorten the code
Edit: Made a few minor changes and commented the code. I used asterisks in my comments as a way of visualizing where a memory leak may occur. If you see a "*Goto label " or "**Goto label "" or any number of asterisks, it is inside a conditional/loop or multiple condionals/loops that would cause a memory leak. I might also upload something showing tab notation later.
Comment syntax:
// Indicates a comment
* Indicates it is inside a conditional or loop needing an end statement yet
** Indicates it is inside a conditional or loop, inside of a conditional or loop, and needs 2 end statements yet.
Edit x2
Here is what it would look like in tab notation. If a Goto is not all the way to the left, then you have a memory leak:
ClrHome
Lbl 0
SetUpEditor ʟSCO //Create or unarchive the list, error prevention
3→dim(ʟSCO //set the length of the list to 3, error prevention
0→W //Set it to know we haven't won this round
Menu("Guess the number","Play",1,"Highscores",2,"Quit",3
Lbl 1 //Play Game
0→S //Set score to 0
ClrHome
Output(3,1,"Range is 1-100 //tell the player the range
Pause
ClrHome
randInt(1,100→A //Generate our number
Lbl 4
ClrHome
Output(5,1,"Guess //ask for their guess
Input B //they input their guess
S+1→S //Add 1 to their score
1→T //Reset the flag so we test both conditions
ClrHome
If T(B>100):Then //IF THE GUESS IS OVER 100
0→T //Set the test flag to not test the other condition
Output(3,7,"!!!GUESS OUT!!! //Tell the user their guess is out of range
Output(4,7,"!!!OF RANGE.!!!
Output(6,7,"YOUR GUESS:
Output(6,19,B
Output(8,6,"NUMBER LIMIT: 100
Output(10,2,"PRESS ENTER TO TRY AGAIN
End // End the conditional
If B<A:Then //IF THE GUESS IS LESS THAN A
Output(5,9,"TOO LOW! //Tell the user it is too low
Output(10,2,"PRESS ENTER TO TRY AGAIN
End // End the conditional
If T(B>A):Then //IF B IS GREATER THAN A and IT IS NOT OVER 100
Output(5,8,"!TOO HIGH! //Tell the user it is 100 High
Output(10,2,"PRESS ENTER TO TRY AGAIN
End //End the conditional
If B=A:Then //IF B EQUALS A
1→W //Set the flag so the program knows the game is won
Output(5,6,"!!YOU GOT IT !! //Tell the user they won
Output(10,2,"PRESS ENTER TO CONTINUE
Pause
ClrHome
Output(4,9,"SCORE: //Tell the user their Score
Output(4,16,S
Output(10,2,"PRESS ENTER TO CONTINUE
Pause
ClrHome
End //End the conditional
If not(W:Goto 4 //If the game has not been won, goto where they enter their guess
If sum(W(S<ʟSCO //IF THE GAME HAS BEEN WON and THEIR SCORE IS GREATER THAN ANY HIGH SCORE
Then
Output(1,1,"NEW HIGHSCORE!!! //Tell them they got a high score
Output(3,1,"PRESS ENTER TO SAVE SCORE
Pause
ClrHome
Input Str4 //Have them input a highscore name
sum(S<ʟSCO→L //Find which scores they beat
4→dim(ʟSCO //Extend the length of the scores list by 1
For(E,0,L //FOR EACH ITEM from 0 to the number of scores we beat
ʟSCO(3-E→ʟSCO(4-E //Move the item at the end of the list up 1 position, creating a gap for our high score
End //End the for loop
S→ʟSCO(L) //Insert our high score in the proper position
If L=1 //If we got the third highest score
Str4→Str3 //Store our name into the third string
If L=2 //IF WE GOT THE SECOND HIGHEST SCORE
Then
Str2→Str3 //Store the second string to the third string
Str4→Str2 //Store our name into the second string
End //End the conditional
If L=3:Then //IF WE GOT THE FIRST HIGHEST SCORE
Str2→Str3 //Store the second string into the third string
Str1→Str2 //Store the first string into the second string
Str4→Str1 //Store our name into the first string
End //End the conditional
ClrHome
Output(1,1,"***HIGHSCORES*** //Display the highscores
Output(2,1,"NAME:
Output(2,21,"SCORE:
Output(3,1,"----------------
Output(4,1,"1)
Output(5,1,"2)
Output(6,1,"3)
Output(4,4,Str1
Output(5,4,Str2
Output(6,4,Str3
Output(4,24,ʟSCO(1)
Output(5,24,ʟSCO(2)
Output(6,24,ʟSCO(3)
Output(8,8,"BACK=ENTER
End //End the conditional
Pause //Wait for enter, this was put outside the conditional as a failsafe
Goto 0 //Restart the game after we win, put outside the conditional to prevent memory leaks
Lbl 2 //Display the highscores
ClrHome
Output(1,1,"***HIGHSCORES***
Output(2,1,"NAME:
Output(2,21,"SCORE:
Output(3,1,"----------------
Output(4,1,"1)
Output(5,1,"2)
Output(6,1,"3)
Output(4,4,Str1
Output(5,4,Str2
Output(6,4,Str3
Output(4,24,ʟSCO(1)
Output(5,24,ʟSCO(2)
Output(6,24,ʟSCO(3)
Output(8,8,"BACK=ENTER
Pause
Goto 0
Lbl 3 //Exit
ClrHome
Stop