home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 14 / 014.d81 / textrapolation-2 (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  948b  |  21 lines

  1. 10 rem textrapolation 2/3 -- prediction = 2 out of 3 choices before
  2. 100 dim a(255) ,b(255), c(255):rem reserve space for saving letters
  3. 110 print"[147][144]begin typing...":poke53281,1:poke53280,7:wait198,1
  4. 190 print"[147][144]":poke53281,1:poke53280,7:      nl=0
  5. 200 :
  6. 210 get x$: if x$="" then 210:              rem wait for user to type a letter
  7. 211 ifx$="_"then63000
  8. 212 l=l+1:ifl>38thenprint:print:print:      l=0:nl=nl+1:ifnl=7then190
  9. 220 print"[144]"chr$(8);x$;:                  rem backspace-then print chosen letter
  10. 300 x1=asc(x$): n=n+1: if p=x1 then r=r+1: rem convert character, add one
  11. 305 ifp=0then380
  12. 350 print "[157]"chr$(p)"[145]";:                 rem show prediction on screen
  13. 380 cl=peek(214):cc=peek(211):              print"[144]score:"r;
  14. 382 poke783,0:poke781,cl:poke782,cc:        sys65520
  15. 400 c(x0)=b(x0): b(x0)=a(x0): a(x0)=x1:     x0=x1: rem shift in new information
  16. 420 p=a(x0): if b(x0)=c(x0) then p=b(x0): rem does stuff
  17. 500 goto 200
  18. 63000 rem   reconnect to boot program
  19. 63002 print"[147]load"chr$(34)"text boot"      chr$(34)",8":print"run"
  20. 63004 poke631,13:poke632,13:poke198,2:        end
  21.