home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 70
/
070.d81
/
input.bas
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
1KB
|
34 lines
9000 t=-1:cp=0:x=peek(211):y=peek(214):l=peek(648)*256+y*40+x:ifli=0thenli=39
9010 in=0:ifpeek(l)=32orpeek(l)=96orpeek(l)=160orpeek(l)=224thenw$=""
9020 fori=l+54272tol+54272+li:pokei,peek(646):next
9030 geta$:on-(ti>15)gosub9170:ifa$=""then9030
9040 on-(a$="")-2*(a$="[157]")-3*(a$=chr$(13))-4*(a$="")goto9120,9140,9310,9180
9050 on-(a$=chr$(20))-2*(a$=chr$(148))-3*(a$="")goto9190,9210,9280
9060 if(a$<" "ora$>"_")thenifa$<"[193]"ora$>"[218]"then9030
9070 iflen(w$)>=lithen9030
9080 on-(cp<len(w$))-2*(cp>=len(w$))goto9090,9110
9090 w$=left$(w$,cp)+a$+mid$(w$,cp+1-in):gosub9160:cp=cp+1:gosub9290:gosub9300
9100 goto9030
9110 w$=w$+a$:gosub9160:cp=cp+1:printa$;:goto9030
9120 iflen(w$)thenifcp<len(w$)thengosub9160:cp=cp+1:gosub9170:poke212,0:print"";
9130 goto9030
9140 iflen(w$)thenifcp>0thengosub9160:cp=cp-1:poke212,0:print"[157]";:gosub9170
9145 ifni=1thenin=-1:ni=0
9150 goto9030
9160 iftthenreturn
9170 pokel+cp,peek(l+cp)+128and255:ti$="000000":t=nott:return
9180 in=notin:goto9030
9190 on-(cp=0)-2*(cp<len(w$)andcp>0)-3*(cp>=len(w$))goto9030,9230,9270
9200 goto9030
9210 iflen(w$)<lithenpoke631,32:poke632,157:poke198,2:ifin=-1thenni=1:in=0
9220 goto9030
9230 ifcp>1then9250
9240 gosub9160:w$=mid$(w$,cp+1):gosub9290:goto9260
9250 gosub9160:w$=left$(w$,cp-1)+mid$(w$,cp+1):gosub9290
9260 poke211,x+cp:poke214,y:sys58732:cp=cp-1:goto9030
9270 gosub9160:w$=left$(w$,len(w$)-1):gosub9290:print"[157]";:cp=cp-1:goto9030
9280 gosub9160:cp=0:gosub9170:goto9030
9290 poke211,x:poke214,y:sys58732:printw$" ";:return
9300 poke211,cp+x:poke214,y:sys58732
9310 gosub9160:return