Confusion

Developer(s): Floyd Chrysler
Date: 1983
Type: Program
Platform(s): TS 2068

Appears on

Source Code

 8800 GO SUB 9990
 9901 REM  ** CONFUSION **            from Practical Computing             September 1983             entered by: F. Chrysler
 9902 LET LINE=256*PEEK PROG+PEEK (PROG+1)
 9903 LET LENGTH=PEEK (PROG+2)+256*PEEK (PROG+3)
 9904 IF LINE>=10000 THEN STOP 
 9906 GO SUB 9988: IF CY=2 THEN LET CY=3
 9907 PRINT LINE;" ";
 9908 INPUT "ENTER NEW LINE NO. ";B$: IF B$="" THEN GO TO 9914
 9910 LET LINE1=VAL B$: IF LINE1<=0 OR LINE1>9999 THEN GO TO 9908
 9912 POKE PROG,INT (LINE1/256): POKE PROG+1,LINE1-256*PEEK PROG: LET LINE=LINE1
 9914 GO SUB 9986: PRINT LINE;" ";
 9916 FOR K=0 TO LENGTH-1: LET Z=PROG+4+K: GO SUB 9920: NEXT K
 9918 PRINT : LET PROG=PROG+K+4: GO TO 9902
 9920 LET Y=PEEK Z: IF Y<>34 THEN GO TO 9926
 9922 PRINT CHR$ Y;: LET K=K+1: LET Z=Z+1: LET Y=PEEK Z
 9923 IF Y<>34 THEN GO TO 9922
 9924 PRINT CHR$ Y;: RETURN 
 9926 IF Y<>234 THEN GO TO 9934
 9928 POKE usr+1,Y-165: RANDOMIZE USR usr
 9930 LET K=K+1: LET Z=Z+1: LET Y=PEEK Z
 9931 IF Y<>13 THEN PRINT CHR$ Y;: GO TO 9930
 9932 RETURN 
 9934 IF (Y>31 AND Y<40) OR (Y>47 AND Y<59) THEN PRINT CHR$ Y;: RETURN 
 9935 IF (Y>62 AND Y<92) OR (Y>94 AND Y<165) THEN PRINT CHR$ Y;: RETURN 
 9936 IF Y>164 THEN GO SUB 9950: RETURN 
 9938 IF Y=13 THEN RETURN 
 9940 IF Y=14 THEN LET K=K+5: RETURN 
 9942 IF Y=41 OR Y=46 OR Y=93 THEN PRINT CHR$ Y;: RETURN 
 9944 IF Y>31 THEN PRINT CHR$ Y;: GO TO 9951
 9946 RETURN 
 9950 POKE usr+1,Y-165: RANDOMIZE USR usr
 9951 IF PEEK (Z+1)=32 THEN PRINT " ";: LET K=K+1: LET Z=Z+1: GO TO 9951
 9952 IF PEEK (Z+1)<48 OR PEEK (Z+1)>57 THEN RETURN 
 9954 LET Z=Z+1: LET J=0: LET A$=""
 9956 IF PEEK (Z+J)<>14 THEN LET A$=A$+CHR$ (PEEK (Z+J)): LET J=J+1: GO TO 9956
 9958 FOR L=0 TO 4: POKE VARS+L,PEEK (Z+J+L+1): NEXT L
 9960 GO SUB 9988: IF CY=3 AND CX-J<1 THEN LET CY=4
 9962 PRINT A$;: PRINT AT 0,0;C$: PRINT AT 0,0;"Really ";A,J;" CHARS MAX."
 9966 GO SUB 9986: INPUT B$: IF B$="" THEN RETURN 
 9968 IF CODE B$(1)<48 OR CODE B$(1)>57 OR LEN B$>J THEN GO TO 9966
 9969 IF LEN B$<J THEN FOR L=LEN B$+1 TO J: LET B$=B$+" ": NEXT L
 9970 FOR L=1 TO J: POKE Z+L-1,CODE (B$(L)): NEXT L: RETURN 
 9986 POKE 23688,CX: POKE 23689,CY: RETURN 
 9988 LET CX=PEEK 23688: LET CY=PEEK 23689: RETURN 
 9990 CLS : LET A=0: LET C$="                                ": LET C$=C$+C$
 9991 GO SUB 9996: RESTORE 9993: INPUT "ENTER ADDRESS FOR USR ";usr
 9992 FOR K=usr TO usr+4: READ L: POKE K,L: NEXT K
 9993 DATA 62,0,195,69,7
 9994 LET VARS=PEEK 23627+256*PEEK 23628+1
 9995 LET PROG=PEEK 23635+256*PEEK 23636: CLS : PRINT AT 2,0;"": RETURN 
 9996 PRINT "         CONFUSION": PRINT : PRINT "The idea of this program is to  enable the user to enter false  numeric data into a programme.": PRINT "Every time a number is found in the text you will be prompted toenter an alternative value."
 9997 PRINT "If you don't wish to change it, press <ENTER>. Otherwise type inthe value you want, first. Note that the 'real' value is not    changed, only the text value."
 9998 PRINT "The present true value is shown at top left. The maximum number of characters allowed is at top centre."
 9999 PRINT "You can also change the line    numbers, but this is for real.  You will now be asked to enter  the address where a 5 byte      machine code routine may be put.": RETURN 
Scroll to Top