` ``:max(1,min(8,A+(Ans=34)-(Ans=25→A I wrote :max(1,min(8,A+(Ans=25→A or something like that`

` ``:randInt(1,8→Y`

with

` ``:int(8rand+1→Y`

I did this because my calculator is a TI-82 which doesn't have randInt (at least not where other models have it). Is this causing the problem? if not what line should I look at?

]]>:randInt(1,8→Y

:ClrHome

So I want to know how to add in a new line without having to delete the whole thing ]]>

` ``:3→A:4→X :1→S:1→T :randInt(1,8→Y :Repeat K=45 or X=1 and A≠Y :ClrHome :Output(A,1,"[ :Output(Y,X,"O :getKey→K :max(1,min(8,A+(Ans=34)-(Ans=25→A :T(Y>1 and Y<8)+(Y=1)-(Y=8→T :S(X>1 and X<16)+(X=1)-(X=16→S :X+Ans→X:Y+T→Y :End :Pause "Game Over! :ClrHome:"`

The min( command is used to find the lowest number in a list, where the max( command is used the find the highest number in the list. For example, "min({1,2,3})" will give you 1, and "max({1,2,3})" will return 3.

Combining the two essentially makes limits. "min(8,max(1,A→A" makes it so that the lowest A can be is 1, and the highest 8. Note that IT ISN'T "min(1,max(8,A→A" like The Cow posted, because that means if A is greater than 8 like 9, the command would be "min(1,max(8,9))" which would then be "min(1,9)" and return 1, instead of 8.

There's more info on these on the wiki if you want, just search them up. ^.^

]]>So Max(1,Min(8,~~~→A

first finds and returns the smaller value of 8 or ~~~. So if ~~~ is more than 8, the return value (Let's call it B) is made to be 8 instead.

Likewise, Max returns the larger value of 1 the value B. If B is less than one, the return value is made to be 1, since 1 would be the maximum of the set {1,A}.

Essentially this does the same thing as:

` ``:~~~ ;Some expression :If Ans<1 :1 :If Ans>8 :8 :Ans→A`

Though using less memory, and probably faster.

]]>