` ``ClrHome Disp " P1:100-COM:100 100→H:Ans→P 4→Y:2→X randInt(2,8→B 15→A Output(4,6,"Ready? Pause Output(4,6," DelVar E Lbl 0 Repeat max({0,0,45}={P,H,K Output(Y,X,"π getKey→K Output(B,A,"* rand If Ans<.3:Then Output(B,A," A-(A>X+1)+(A<X-1→A B-(B>Y)+(B<Y→B Output(B,A,"* End If max(K={21,105,24,25,26,34:Then Output(Y,X," max(2,min(15,X+(K=26)-(K=24→X max(2,min(8,Y+(K=34)-(K=25→Y If (Y=B)(abs(X-A)=1)max(K={21,105:Then Output(Y,X,"π X+1-2(X>A) Output(Y,Ans,"- For(I,1,40:End Output(Y,Ans," If max(A={Ans,X:Then P-5→P Output(1,13," Output(1,13,Ans End End End If (Y=B)(rand<.25)max(A={X-1,X+1:Then Output(B,A,"* A+1-2(A>X) Output(B,Ans,"- For(I,1,40:End Output(B,Ans," Output(1,5," H-5→H Output(1,5,Ans End End ClrHome Disp "You "+sub("LostWon!Tied",1+4(H>P)+8(H=P),4 Return`

I would like to mention that there was a fair bit of optimization in the peicewise statements. You may have noticed I was able to get rid of N, and O simply by putting what sets N and O into what changes A and B.

]]>` ``E or max(K={45,21,105 functions like this: Check if E; put result it in "bit" 1 Check if max(K={45,21,105; put result in "bit" 2 If either "bit" is 1, return 1; else return 0; E+max(K={45,21,105 functions like this: Take the value of E and add it to max(K={45,21,105; store the result in "register" 1 If the value in register 1 is 0, return 0; else return 1;`

Obviously that's not exactly how it functions, but its generally how the logic is implemented on a bit-wise level. Note also that some processors will skip checking further arguments to or as soon as it finds that one is true, but I don't believe any of the TI's do this. Now, when running 1, 10, or even 1000 comparisons there is a difference which is negligible. However, when I ran 10,000 checks in a for loop with the timer on a TI-84+SE emulated in WabbitEmu, the times were slightly different. Using `E or max(K={45,21,105` it took 106 seconds. When using `E+max(K={45,21,105` my test only took 103 seconds.

So yes, you are right. There is no **practical** difference. But there is still a difference. I will also make note that the larger the comparands, the slower addition becomes. Again though, the difference is almost nonexistent.

Repeat E or max(K={45,21,105

- could be -

Repeat E+max(K={45,21,105

These are the same size and speed; no advantage to changing it. When adding 1s and 0s `or` and `+` are equally fast.

If I can find the darn USB…

]]>The released game is supposed to be 4,145 bytes with 358 lines of code. This will be in a GROUP file, containing the original sample program, and the full program.

]]>Refer to:

`If A=Ans or X=A`

randInt(0,1) can be rand<.5, since rand is faster than randInt. This also makes the probability a bit more clear. For example, randInt(0,3) corresponds to a 25% probability of a 0, or a 75% probability of success. This would be the same thing as rand<.75; See how the second one is more readable? Since rand is from 0 to 1, there is a 75% chance that it will be less than .75 or a 25% chance that it will be greater. We can also ignore less than or equal to, since it will never be exact to the tenths digit

` ``If Y=B and randInt(0,1) and max(A={X-1,X+1 - could be - If (Y=B)(rand<.5)*max(A={X-1,X+1 If A=Ans or X=A:Then - could be - If (A=Ans)+(X=A):Then - or - If sum(A={Ans,X:Then Repeat E or max(K={45,21,105 - could be - Repeat E+max(K={45,21,105`