I think I see a few problems in your code.
So you want the menu to loop until the enter key is pressed correct? So you need to stuff lines 14-17 into a Repeat loop.
Code:
1->C
36->B
ClrDraw
For(A,1,36,1
Text(1,100,"School
Line(0,238,180,238,Black
Text(1,170,"Days Left: ",B
Text(15,1,"Activites:
Text(30,1,"Play tag (athleticism)" //c=1
Text(45,1,"Study math (intellegence)" //c=2
Text(60,1,"Flirt with girls/guys (charisma)" //c=3
Text(75,1,"Play with some dice (Luck)" //c=4
Repeat K=105
getKey->K
If K=25:C-1->C
If K=24:C+1->C
If C<1:4->C
If C>4:1->C
End
//...
End
Now for lines 14-17 this can be optimized to
Code: max(1,min(4,C+sum(ΔList(K={25,34→C
This sets the lowest value to 1, the highest value to 4.
Delta list is kinda complex but it'll return either 1 or -1 depending if K=25 or 34 (it'll return 0 if it's neither). It then adds that result to C's original value. This is what increases or decreases the value of C.
So now you have
Code:
1->C
36->B
ClrDraw
For(A,1,36,1
Text(1,100,"School
Line(0,238,180,238,Black
Text(1,170,"Days Left: ",B
Text(15,1,"Activites:
Text(30,1,"Play tag (athleticism)" //c=1
Text(45,1,"Study math (intellegence)" //c=2
Text(60,1,"Flirt with girls/guys (charisma)" //c=3
Text(75,1,"Play with some dice (Luck)" //c=4
Repeat K=105
getKey->K
max(1,min(4,C+sum(ΔList(Ans={25,34→C //note: I changed the K to Ans since the getKey was the line immediately above this one.
End
//...
End
Now here's an issue, you're using a While loop which will repeat until C does not equal <number> but you never change the value of C in the loop so it creates an infinite loop. Some nested If:Then:Else statements would be better suited.
Code:
If C=1
Then
TextColor(Black
Text(30,1,"Play tag (athleticism)
Else
If C=2
Then
TextColor(Black
Text(45,1,"Study math (intellegence)
Else
If C=3
Then
TextColor(Black
Text(60,1,"Flirt with girls/guys (charisma)
Else
If C=4
Then
TextColor(Black
Text(75,1,"Play with some dice (Luck)
End
End
End
End
This can be optimized, but that would take a while for me to do so this should be good enough.
Now another issue with your code, you have
If K=105 and C=1
B-1->B
//Run tag program
But you don't have a Then command, therefore the If statements only applies to the B-1->B. This means that the tag program will always be run.
I'm not sure if you mean by run tag program, so I'll assume you're jumping to a subprogram.
You shouldn't ever jump to a subprogram within an If:Then statement since it creates a memory leak.
You can however, jump to a subprogram within just an If statement.
Code: If max(K={1,2,3,4 //this checks if K= 1, 2, 3, or 4
B-1->B// I added this since you do this anyways in all your If statements.
If C=1//since K [b]must[/b] = 105 to have escaped the loop above so you can remove all the K=105
//Run tag program
If C=2
//Run Math program
If C=3
//Run Charisma program
If C=4
//Run Dice program
So final result
Code:
1->C
36->B
ClrDraw
For(A,1,36,1
Text(1,100,"School
Line(0,238,180,238,Black
Text(1,170,"Days Left: ",B
Text(15,1,"Activites:
Text(30,1,"Play tag (athleticism)" //c=1
Text(45,1,"Study math (intellegence)" //c=2
Text(60,1,"Flirt with girls/guys (charisma)" //c=3
Text(75,1,"Play with some dice (Luck)" //c=4
Repeat K=105
getKey->K
max(1,min(4,C+sum(ΔList(Ans={25,34→C
End
If C=1
Then
TextColor(Black
Text(30,1,"Play tag (athleticism)
Else
If C=2
Then
TextColor(Black
Text(45,1,"Study math (intellegence)
Else
If C=3
Then
TextColor(Black
Text(60,1,"Flirt with girls/guys (charisma)
Else
If C=4
Then
TextColor(Black
Text(75,1,"Play with some dice (Luck)
End
End
End
End
If max(K={1,2,3,4
B-1->B
If C=1
//Run tag program
If C=2
//Run Math program
If C=3
//Run Charisma program
If C=4
//Run Dice program
End
(hopefully that works)
Now you may want to add an indicator to where the cursor is currently at. If you need help with this just post and I'll try to help you.