home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 14
/
014.d81
/
textrapolation-2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
948b
|
21 lines
10 rem textrapolation 2/3 -- prediction = 2 out of 3 choices before
100 dim a(255) ,b(255), c(255):rem reserve space for saving letters
110 print"[147][144]begin typing...":poke53281,1:poke53280,7:wait198,1
190 print"[147][144]":poke53281,1:poke53280,7: nl=0
200 :
210 get x$: if x$="" then 210: rem wait for user to type a letter
211 ifx$="_"then63000
212 l=l+1:ifl>38thenprint:print:print: l=0:nl=nl+1:ifnl=7then190
220 print"[144]"chr$(8);x$;: rem backspace-then print chosen letter
300 x1=asc(x$): n=n+1: if p=x1 then r=r+1: rem convert character, add one
305 ifp=0then380
350 print "[157]"chr$(p)"[145]";: rem show prediction on screen
380 cl=peek(214):cc=peek(211): print"[144]score:"r;
382 poke783,0:poke781,cl:poke782,cc: sys65520
400 c(x0)=b(x0): b(x0)=a(x0): a(x0)=x1: x0=x1: rem shift in new information
420 p=a(x0): if b(x0)=c(x0) then p=b(x0): rem does stuff
500 goto 200
63000 rem reconnect to boot program
63002 print"[147]load"chr$(34)"text boot" chr$(34)",8":print"run"
63004 poke631,13:poke632,13:poke198,2: end