1 REM TM1 -- EASY TM SIMULATOR
199 REM TAPE
200 T$="XXXXXbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
210 S$="0":REM STARTING STATE = 0
220 P=1:REM STARTING POSITION ON TAPE = 1
400 PRINT:PRINT T$
410 PRINT TAB(P);"^":REM POSITION OF READ-WRITE HEAD
420 IF S$ = "." THEN END
499 REM L.500 - 520 DOES STATE TABLE LOOKUP
500 M$= S$ + MID$(T$,P,1)
510 RESTORE
520 READ R$:IF MID$(R$,1,2) <> M$ THEN 520
600 PRINT:PRINT S$,R$
610 INPUT "",X
799 REM REWRITE SYMBOL ON TAPE
800 MID$(T$,P,1)=MID$(R$,4,1)
819 REM MOVE LEFT ON TAPE
820 IF MID$(R$,6,1)="L" THEN P=P-1
829 REM MOVE RIGHT ON TAPE
830 IF MID$(R$,6,1)="R" THEN P=P+1
840 S$=MID$(R$,5,1):REM DETERMINE NEW STATE
900 GOTO 400
2000 DATA "0X-b1R","0b-E.." :REM STATE 0
2010 DATA "1X-b0R","1b-O.." :REM STATE 1
,1):REM DETERMINE NEW STATE
900 GOTO 400
2000 DATA "0X-b1R","0b-E.." :REM STATE 0
2010 DATA "1X-b0R","1b-O.." :REM S