[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT: question about programming in TinyBasic



On 3/11/10 9:08 PM, in article
af3121cd-f1f2-4ebc-9fdc-ff40e3d38bfa@a10g2000pri.googlegroups.com, "Nama"
<forums6000@mac.com> wrote:

> Well, I know someone here will know the answer to this. I'm curious
> how you would adapt the following lines to Tinybasic.
> 
> 4110 IF X <> 1 AND X <> 23 THEN GOTO 5000
> 4120 IF X = 1 AND (Z < P - 1 OR Z > P + 4) THEN GOTO 6000
> 4130 IF X = 23 AND (Z < Q - 1 OR Z > Q + 4) THEN GOTO 6000
> 
> 5010 IF P = 21 AND R = 1 THEN LET R = 0
> 5010 IF P = 0 AND R = -1 THEN LET R = 0
> 5010 IF Q = 21 AND S = 1 THEN LET S = 0
> 
> In the version of tinybasic that I'm using, within  'if...then' lines
> I can not use 'and' or 'or' statements.
> Does anyone have an easy and clean solution?

Boolean logic. TI Basic did not have AND and OR either.
You use * for AND and + for OR and check for valid truth values.