This month we will start tying a lot of loose ends together. Since the TS-1000 and the 2068 use different commands to draw the face, we will start with the TS-1000:
850 GOTO 3000
852 SLOW
855 FOR N=1 TO 20
860 PLOT 15*SIN (N*PI/10)+33,10*COS (N*PI/10)+22
865 NEXT N
870 STOP
RUN this part of the program. In line 860, try swapping 10* and 15* and RUN or use 10* twice and RUN. Use the face you like best. Now lets add the eyes, nose, and mouth:
870 PLOT 28,26
875 PLOT 36,26
880 PLOT 31,22
885 PLOT 34,17
890 PLOT 33,17
895 PLOT 32,17
900 PLOT 31,18
910 PLOT 35,18
On the 2068, we use:
850 GOTO 3000
860 CIRCLE 120,88,40: CIRCLE 12 0,88,2
880 CIRCLE 105;,98,52. CIRCLE 130 ,98,5
890 CIRCLE 105,98,2: CIRCLE 130 198,2
900 PLOT 104,78
910 DRAW 30,0,.8*PI
On both models add:
920 PRINT AT 8,0;"CORRECT, ";AT 10,0;F$
930 PAUSE 300
935 CLS
940 RETURN
950 STOP
3390 IF X+Y=Z THEN GOSUB 860
3350 PRINT AT 6,0;X;"+";Y;"=?"
That “draws” a smiley face whenever a correct answer is given. For wrong answers, the following routine “draws” a frowney face on the screen. First the 1000:
1000 FOR N=1 TO 20
1005 PLOT 15*SIN (N*PI/10)+33,10*COS (N*PI/10)+22
1008 NEXT N
1010 PLOT 28,26
1015 PLOT 38,26
1020 PLOT 33,22
1025 PLOT 35,16
1030 PLOT 34,17
1035 POLT 33,17
1040 PLOT 32,17
1045 PLOT 31,16
For the 2068:
1000 CIRCLE 120,88,40: CIRCLE 120,88,2
1020 CIRCLE 105,98,5: CIRCLE 130,98,5
1030 CIRCLE 105,98,22: CIRCLE 130,198,2
1040 DRAW -30,0,.8*PI
On both models:
1150 PRINT AT 8,0;" TOO BAD, ";AT 10,0;F$
1160 LET A=A-1
1170 PAUSE 300
1180 CLS
1190 RETURN
3400 IF Z<>X+Y THEN GOSUB 1000
3410 IF Z<>X+Y THEN GOTO 335
This last part is your examination. The first 19 lines of the program are duplicated for the other model. The object of this test is to sort out the lines for your computer. For the TS 1000, you may have to split up some lines, like line 10. Remember that the program autoruns on line one.
10 CLS : PRINT AT 2,10;"SMILEY FACE"
20 PRINT AT 20,10;"BILL WOODWARD"
30 PRINT AT 10,1;"PUBLIC"; TAB 25; "DOMAIN"
40 BORDER 3: PAPER 6: INK 0
50 FOR M=0 TO 30: PRINT AT 0,M;"+": NEXT M
60 FOR N=1 TO 20: PRINT AT N,0;"/": NEXT N
70 FOR O=0 TO 31: PRINT AT 21,O;"-": NEXT O
80 FOR P=1 TO 21: PRINT AT P,31;"*": NEXT P
90 CIRCLE 112,98,5: CIRCLE 137,98,5: FLASH 1: CIRCLE 112,98,2: CIRCLE 137,98,2
100 FLASH 0: PLOT 111,78: DRAW 30,0,.8*PI
110 CIRCLE 127,88,50: PRINT AT 10,15;"B"; AT 11,15;"Y": CIRCLE 127,88,2
120 CIRCLE 48,32,20: PLOT 48,32: PLOT 43,37: PLOT 53,37: PLOT 43,25: DRAW 9,0,.8*PI
130 CIRCLE 207,32,20: PLOT 207,32: PLOT 202,37: PLOT 212,37: PLOT 203,25: DRAW 9,0,.8*PI
140 CIRCLE 48,143,20: PLOT 48,143: PLOT 43,148: PLOT 53,148: PLOT 43,140: DRAW 9,0,.8*PI
150 CIRCLE 207,143,20: PLOT 207,143: PLOT 202,148: PLOT 212,148 :PLOT 202,140: DRAW 9,0,.8*PI
170 PAUSE 200
180 FLASH 1: PRINT AT 20,5;"PRESS ENTER TO CONTINUE"
190 PAUSE 0: FLASH 0
And…
50 SLOW
60 FOR N=1 TO 20
70 PLOT 15*SIN (N*PI/10)+33,10*COS (N*PI/10)+22
80 NEXT N
90 PLOT 28,26
100 PLOT 38,26
110 PLOT 33,22
120 PLOT 35,18
130 PLOT 34,17
140 PLOT 33,17
150 PLOT 32,17
160 PLOT 31,18
Programmer’s hint: on the TS 1000, use a FOR – NEXT loop instead of PAUSE. The FOR – NEXT loop gets rid of the flickering that PAUSE causes. For example, instead of PAUSE 1000, use:
FOR N=1 TO 1000
NEXT N
This completes the program, “SMILEY FACE”. If you make any improvements, please send them to SUM Magazine. There are a lot of ways to improve this program. Most young people that I have shown this to have really enjoyed it with the positive feedback it provides to the proper answer.
Products
Downloadable Media
Image Gallery
Source Code
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.