• Please review our updated Terms and Rules here

Struggling to get TI Basic Program to work on a TI74

Joined
Jan 22, 2021
Messages
13
I am trying to get the following TI99 Program to work on my TI74. The program should show 3 different spellings of a word where only 1 is correct.

It doesn't get past displaying the line 180 and you break the program at line 270.

Any help will be appreciated!


110 REM SPELLING TEST
150 RANDOMIZE
160 DIM WD$(20,3)
170 RX=INT(RND*3+1)
180 PRINT "SPELLING TEST":pAUSE 2.5
190 REM READ IN DATA
200 FOR J=1 TO 20
210 FOR K=1 TO 3
220 READ WD$(J,K)
230 NEXT K
240 NEXT J
250 REM CHOOSE WORD & ORDER
260 R1=RX
270 R2=RX
280 IF R1=R2 THEN 270
290 R3=RX
300 IF(R3=R1)+(R3=R2)THEN 290
310 RD=INT(RND*20+1)
320 IF RD=RWD THEN 310
330 RWD=RD
340 PRINT "1. ";WD$(RWD,R1):pAUSE 3.5
350 PRINT "2. ";WD$(RWD,R2):pAUSE 3.5
360 PRINT "3. ";WD$(RWD,R3):pAUSE 3.5
370 PRINT "WHAT IS THE CORRECT SPELLING?":pAUSE 3
380 INPUT AN$
400 IF AN$=WD$(RWD,1)THEN 430
410 PRINT "TRY AGAIN!":pAUSE 3
420 GOTO 380
430 PRINT "THAT IS CORRECT!!":pAUSE 3
440 GOTO 260
450 DATA CARROT,CAROT,CAROTT
460 DATA TELEVISION,TELIVISION,TELEVISON
470 DATA COMPUTER,COMPUTOR,COMPUTAR
480 DATA VEHICLE,VEICLE,VERRCLE
490 DATA RANDOM,RANDEM,RANDAM
500 DATA FEBRUARY,FEBUARY,FEBURARY
510 DATA YELLOW,YELOW,YELLEW
520 DATA SUCCESS,SUCESS,SUCCES
530 DATA SENTENCE,SENTANCE,SENTENSE
540 DATA TOMORROW,TOMMOROW,TOMOROW
550 DATA ENVIRONMENT,ENVIROMENT,ENVIRAMENT
560 DATA BEAUTIFUL,BUEATIFUL,BEATIFULL
570 DATA IMPOSSIBLE,IMPOSIBLE,INPOSSIBLE
580 DATA ILLEGIBLE,ILEGIBLE,ILLEGABLE
590 DATA AMEND,AMMEND,EMEND
600 DATA ORCHESTRA,ORKESTRA,ORCESTRA
610 DATA INTRIGUE,INTRIGE,INTREAGUE
620 DATA PNEUMATIC,NEWMATIC,PNUMATIC
630 DATA WEDNESDAY,WENSDAY,WENDSDAY
640 DATA APPLICATION,APLICATON,APPLICCATION
650 DATA END
 
First thing I see wrong is RX is only set as a random once at 170. At 260 and 270 you set both to this one RX value. At 280 you check if R1 is
equal to R2 and it has to be from 170, and 260, 270. So 280 will always be true and you will jump back to 270 and assign the same original value
to R2 and loop forever. You need to assign a new value to R2 if R1=R2 at 280. Maybe change the check to be <> instead of =. Then if it is = get a new
value for R2 and continue. Also R3 will also have the same value of RX. Is this what you want?
 
It's line 170 that seems to be causing my issue. The TI74 does not allow you to define a function. It does not understand DEF which is part of TI99 Basic.

The game works fine on the TI99 with the line amended to 170 DEF RX=INT(RND*3)+1.

If you take out DEF on the TI99 you also get the program stuck in an endless loop.

I'm not sure of a way to get the program to work on the TI74 !

Any ideas?!
 
Ah, I see in that case RX is a function and gets called each time it is used on the right side of an =. My mistake. Never seen a Basic with DEFine capability or have forgotten if I had. So why not change the "= RX" to be "= INT(RND*3)+1? That would give you a new random value each time for each case.
 
Back
Top