I was reading Kerm's Book on coding the ti 83/84, and saw the cheese game exercise. I wanted to modify it to work better on the ti 84 plus CE, however, while I was trying to figure out how to do it, I created a bug that I don't know how to fix. The program uses "=" on the side of the screen as hunger bars. They are supposed to reset when you eat a cheese by touching it. However, all my program does it move up all of the "=" by one. I tried going through each line of my code, but I still don't know what I did. I'm sure it will be very obvious once pointed out. Thanks.
Code:
Here is the original (I think)
Code:
Code:
7->A:7->B
0->H:0->S
Repeat H>=8 or K=45
randInt(1,23->C
randInt(1,10->D
ClrHome
Output(D,C,"^^2
For(X,1,int(H
Output(8-X,24,"=
End
Repeat H>=8 or K=45 or (C=A and B=D)
If H=int(H
Output(9-H,24,"=
Output(B,A,"M
getKey->K
If K
Output(B,A,"
If K=24 and A>1
A-1->A
If K=26 and A<24
A+1->A
If K=25 and B>1
B-1->B
If K=34 and B<9
B+1->B
If S<10
H+.1->H
If S>10
H+.2->H
If S>20
H+.25->H
End
End
If C=A and B=D
Then
0->H
S+1->S
End
Output(3,1,"------------
Output(4,1," YOU ATE
Output(4,10,S
Output(5,1,"PIECIES OF CHEESE
Output(6,1,"------------
Pause
ClrHome
Here is the original (I think)
Code:
7→A:7→B
0→H:0→S
Repeat H≥8 or K=45
randInt(1,15→C
randInt(1,8→D
ClrHome
Output(D,C,"▫
For(X,1,int(H
Output(16-X,25,"=
End
Repeat H≥10 or C=A and B=D
If H=int(H
Output(10-H,16,"=
Output(B,A,"M
getKey→K
If K
Output(B,A,"
If K=24 and A>1
A-1→A
If K=26 and A<15
A+1→A
If K=25 and B>1
B-1→B
If K=34 and B<8
B+1→B
If S<10
H+.1→H
If S>10
H+.2→H
If S>20
H+.25→H
End
If C=A and B=D
Then
0→H
S+1→S
End:End
Output(3,1,"
Output(4,1," YOU ATE
Output(4,10,S
Output(5,1,"PIECIES OF CHEESE
Output(6,1,"
Pause
ClrHome