Curve Tracing – 2068

Author(s): Basil Wentworth
Publication: SyncWare News
Pub Details: SyncWare News v3 n2 (Volume 3, Issue 2)
Date: Nov-Dec 1985
Pages: 10-11

Here’s a little program that will let you use the TS 2068 to print mathematical curves, handwriting, doodles, or what-have-you.

All you do is draw (or write) the desired copy on your monitor screen, and then use the program to approximate the picture with a series of line segments. Use a grease pencil or a felt-tipped pen to draw the picture on the screen, and be sure that you don’t let the line go outside the limits of the display. A good way to make sure that your picture stays in bounds is to use a BORDER of contrasting color while you are drawing it in.

GO TO 1 gives you the MENU, with options NEW, PRINT, and SAVE. In case you didn’t recognize the fact at once, the keys used for these respective choices are the ones that bear the corresponding keywords. When you have made your selection, you confirm it by pressing Y (or y), or give yourself another chance by pressing any other key.

The choice of SAVE puts you into a SAVE-VERIFY routine, in which you choose the name under which you want to SAVE the program, and the rest is fairly automatic.

PRINT prints out any picture that you already have in the memory.

If you choose NEW, the program starts in PLOT mode, letting you PLOT the first location of your “pencil”. The arrow keys 5-8 are used to position your “pencil”, with the unshifted key moving one space in the indicated direction, the CAPS SHIFTed key moving 5 spaces, and the SYMBOL SHIFTed key moving 10 spaces.

When you have moved the spot to where you want it, “freeze” it by pressing either “Q” (for PLOT) or “W” (for DRAW), along with the SYMBOL SHIFT. If you choose PLOT, then the procedure will be repeated. If you choose DRAW, then the line will start from the last PLOT position, going as far as you choose, in the direction you choose, according to your use of the arrow keys and the SHIFT keys. When you want to lift up the “pencil” and start from a new position, make the PLOT choice again. STOP will stop the program, and you can return to the MENU at any time by shifted 1 (EDIT).

Since the co-ordinates you can use for PLOT and DRAW are limited to the range 0-255, the value of each move can be stored as its CHR$ in h$ and v$, while i$ keeps a record of whether each move is a PLOT or a DRAW. S$ is used to tell the computer whether the respective values of h$ and v$ are to be construed as positive or negative. (They can be negative in the case of DRAW.) But don’t try to PRINT the various strings–you are very likely to run into some unprintable characters, giving you an error message of “K Invalid color”.

  10 GO TO 600
20 REM INKEY$
30 IF INKEY$<>"" THEN GO TO 30
40 IF INKEY$="" THEN GO TO 40
50 LET c=CODE INKEY$
60 RETURN
70 REM VERIFY
80 PRINT '"""";a$;""" OK?"'" Y- N-"
90 GO SUB 20
100 LET y=(c=89)+(c=121)
110 RETURN
600 REM MENU
605 CLS : PRINT '"Do NOT RUN; Use GO TO 1";
610 OVER 1: FOR f=1 TO 23: PRINT CHR$ 8;: NEXT f
615 PRINT "__________": OVER 0
620 PRINT '"PRESS FOR"
625 PRINT '" A NEW"
635 PRINT " P PRINT "
640 PRINT " S SAVE "
645 PRINT '"Thereafter,"
650 PRINT " Shifted ""1"" gives MENU"
660 PRINT " SYMBOL SHIFT ""Q"" gives PLOT"
670 PRINT " SYMBOL SHIFT ""W"" gives DRAW"
680 PRINT '"To move in direction of arrow,"
690 PRINT " 5-8 gives 1 space"
700 PRINT " "" with CAPS SHIFT, 5 spaces"
710 PRINT " "" with SYMBOL SHIFT, 10 spaces"
720 GO SUB 20
730 IF c>90 THEN LET c=c-32
740 LET a$=CHR$ c
750 GO SUB 80
760 IF NOT y THEN GO TO 600
770 IF a$="S" THEN GO TO 7000
780 IF a$<>"A" THEN GO TO 1000
790 LET i$="P": LET s$=""
800 LET h$="": LET v$=""
1000 REM PRINT
1005 CLS
1010 FOR f=1 TO LEN h$
1015 IF i$(f)<>"P" THEN GO TO 1200
1020 PLOT CODE h$(f),CODE v$(f)
1030 GO TO 1300
1210 IF CODE s$(f)=0 THEN DRAW CODE h$(f),CODE v$(f)
1220 IF CODE s$(f)=1 THEN DRAW -CODE h$(f),CODE v$(f)
1230 IF CODE s$(f)=5 THEN DRAW CODE h$(f),-CODE v$(f)
1240 IF CODE s$(f)=6 THEN DRAW -CODE h$(f),-CODE v$(f)
1300 NEXT f
1350 IF a$="P" THEN STOP
1500 LET h=0: LET v=0
1510 LET dh=0: LET dv=0
1520 LET p=(i$(LEN i$)="P")
1540 IF p THEN PLOT dh,dv
1550 IF NOT p THEN DRAW dh,dv
1560 GO SUB 20
1570 IF c=226 THEN GO TO 2000
1580 IF c=7 THEN GO TO 600
1590 IF c=199 OR c=201 THEN GO TO 2000
1600 OVER 1
1610 IF p THEN PLOT dh,dv
1620 IF NOT p THEN PLOT h,v: DRAW dh,dv: PLOT h,v
1625 OVER 0
1630 LET dh=dh+(c=56)-(c=53)+5*((c=9)-(c=8))+10*((c=40)-(c=37))
1640 LET dv=dv+(c=55)-(c=54)+5*((c=11)-(c=10))+10*((c=39)-(c=38))
1650 IF h+dh<0 THEN LET dh=-h
1660 IF v+dv<0 THEN LET dv=-v
1670 IF h+dh>255 THEN LET dh=255-h
1680 IF v+dv>175 THEN LET dv=175-v
1690 GO TO 1520
2000 LET s$=s$+CHR$ ((dh<0)+5*(dv<0))
2010 LET h$=h$+CHR$ ABS dh
2020 LET v$=v$+CHR$ ABS dv
2030 LET h=h+dh: LET v=v+dv
2040 IF c<>201 THEN LET v=0: LET h=0
2050 IF c=201 THEN LET i$=i$+"D"
2060 IF c=199 THEN LET i$=i$+"P"
2070 IF c=226 THEN STOP
2100 GO TO 1510
6999 STOP
7000 REM SAVE
7010 CLS : PRINT '"SAVE under what name?"
7020 INPUT a$
7030 GO SUB 80
7040 IF NOT y THEN GO TO 7010
7050 SAVE a$ LINE 1
7060 BEEP .3,12: BEEP 1,12
7070 PRINT ''"Re-run tape to VERIFY "
7080 VERIFY a$
7090 PRINT ' BRIGHT 1;" VERIFY OK"
7100 BEEP .3,12: BEEP 1,12
"Basil loves Jocelyn" handwriting traced with the program
"Basil loves Jocelyn" handwriting traced with the program

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.