4 Patterns

Developer(s): Ted Knyszek
Date: 198x
Type: Program
Platform(s): TS 2068

Draws several graphics patterns.

Gallery

4 Patterns

Source Code

    5 RUN 1500
   10 REM Patterns 1 
   20 OVER 1: RANDOMIZE 
   30 BORDER 0: PAPER 0: CLS 
   40 LET x=RND*128
   50 LET y=RND*88
   60 INK RND*7: BRIGHT INT (RND*2)
   70 PLOT x,y: PLOT 255-x,y: PLOT x,175-y: PLOT 255-x,175-y
   80 IF INKEY$="" THEN GO TO 40
   90 OVER 0: INPUT "Press ENTER for Menu "; LINE a$: RUN 
  100 REM  Patterns 2 
  110 OVER 1: BORDER 0: PAPER 0: INK 2: CLS 
  120 GO SUB 150
  130 LET a=2: LET i=INT (RND*7)+1: IF i=a THEN GO TO 130
  140 INK i: LET a=i: GO SUB 160: GO SUB 150: GO SUB 150: GO SUB 160: GO TO 130
  150 FOR x=0 TO 255: PLOT x,0: DRAW 255-x,175: PLOT 255-x,175: DRAW x-255,-175: NEXT x: RETURN 
  160 FOR x=0 TO 255: PLOT x,175: DRAW 255-x,-175: PLOT 255-x,0: DRAW x-255,175: NEXT x: RETURN 
  300 REM CONVERTED FROM IBM TO  TS-2068 BY TED KNYSZEK 
  320 BORDER 0: PAPER 0: INK 7: CLS 
  330 DIM X(6): DIM Y(6): DIM T(6): DIM K(6)
  340 LET SU=.12: LET RU=1-SU
  350 FOR I=NOT PI TO 3: FOR J=NOT PI TO 3: IF INT (I-2*INT (I/2))=INT (J-2*INT (J/2)) THEN GO TO 370
  360 LET Y(1)=43: LET Y(2)=0: LET Y(PI)=0: LET Y(4)=43: GO TO 380
  370 LET Y(1)=0: LET Y(2)=43: LET Y(PI)=43: LET Y(4)=0
  380 LET X(1)=1: LET X(2)=1: LET X(PI)=64: LET X(4)=64
  390 FOR N=NOT PI TO 18: LET X1=X(4)+I*63: LET Y1=Y(4)+J*43
  400 FOR M=SGN PI TO 4: LET X2=X(M)+I*63: LET Y2=Y(M)+J*43
  410 PLOT X1,Y1: DRAW (X2-X1),(Y2-Y1): LET X1=X2: LET Y1=Y2: LET NJ=INT (M-4*INT (M/4))+1
  420 LET T(M)=RU*X(M)+SU*X(NJ): LET K(M)=RU*Y(M)+SU*Y(NJ): NEXT M
  430 FOR P=SGN PI TO 4: LET X(P)=T(P): LET Y(P)=K(P): NEXT P: NEXT N: NEXT J: NEXT I
  440 RANDOMIZE USR 50450
  450 PAUSE 300
  460 CLS 
  470 LET SU=.1: LET RU=1-SU: LET II=1: LET C=1
  480 FOR J=NOT PI TO 3: LET II=-II: LET JJ=1: FOR I=NOT PI TO 4: LET JJ=-JJ: IF I<J OR I>4-J THEN GO TO 570
  490 IF J<2 OR I>2 THEN LET C=(C-INT (C/3)*3)+1
  500 IF J=3 THEN LET C=(C-INT (C/3)*3)+1
  510 LET X(1)=0: LET X(2)=39: LET X(PI)=78: LET Y(1)=0: LET Y(2)=-48: LET Y(PI)=0: IF II=JJ THEN LET Y(2)=48
  520 FOR N=SGN PI TO 11: LET X1=3+X(PI)+I*39: LET Y1=160-Y(PI)-J*48+II*JJ*24
  530 FOR M=SGN PI TO 3: LET X2=3+X(M)+I*39: LET Y2=160-Y(M)-J*48+II*JJ*24: LET C=(C-INT (C/3)*3)+1
  540 PLOT X1,Y1-39: DRAW (X2-X1),((Y2-30)-(Y1-30)): LET X1=X2: LET Y1=Y2: LET NJ=(M-INT (M/3)*3)+1
  550 LET T(M)=RU*X(M)+SU*X(NJ): LET K(M)=RU*Y(M)+SU*Y(NJ): NEXT M
  560 FOR P=SGN PI TO 3: LET X(P)=T(P): LET Y(P)=K(P): NEXT P: NEXT N
  570 NEXT I: NEXT J
  580 RANDOMIZE USR 50450
  590 PAUSE 300
  600 CLS 
  610 LET SU=.2: LET RU=1-SU
  620 FOR J=NOT PI TO 2: FOR I=NOT PI TO 2: IF J=0 AND I<>1 THEN GO TO 710
  630 LET E=0: IF I=1 THEN LET E=31
  640 LET X(1)=0: LET X(2)=25: LET X(PI)=75: LET X(4)=100: LET X(5)=75: LET X(6)=25
  650 LET Y(1)=31: LET Y(2)=0: LET Y(PI)=0: LET Y(4)=31: LET Y(5)=62: LET Y(6)=62
  660 FOR N=NOT PI TO 20: LET X1=25+(X(6)+I*75)*.8: LET Y1=(220-Y(6)-J*62-E)*.9
  670 FOR M=SGN PI TO 6: LET X2=25+(X(M)+I*75)*.8: LET Y2=(220-Y(M)-J*62-E)*.9
  680 PLOT X1,Y1: DRAW X2-X1,Y2-Y1: LET X1=X2: LET Y1=Y2: LET NJ=INT (M-6*INT (M/6))+1
  690 LET T(M)=RU*X(M)+SU*X(NJ): LET K(M)=RU*Y(M)+SU*Y(NJ): NEXT M
  700 FOR P=SGN PI TO 6: LET X(P)=T(P): LET Y(P)=K(P): NEXT P: NEXT N
  710 NEXT I: NEXT J
  720 RANDOMIZE USR 50450
  730 PAUSE 300
  740 GO TO 90
 1000 REM TINY TURTLE 
 1010 DEF FN R(X)=X*PI/180
 1020 LET ANGLE=0
 1030 INPUT "NO. OF REPEATS? ";REPEAT
 1040 INPUT "ANGLE TURN TO RIGHT? ";RIGHT
 1050 INPUT "STEPS FORWARD? ";FORWARD
 1060 INPUT "CLEAN BEFORE DRAWING (Y/N)? ";A$
 1070 IF A$="Y" OR A$="y" THEN CLS : PLOT 127,87
 1080 FOR A=1 TO REPEAT
 1090 LET ANGLE=ANGLE+RIGHT
 1100 LET ACROSS=SIN (FN R(ANGLE))*FORWARD
 1110 LET DOWN=COS (FN R(ANGLE))*FORWARD
 1120 DRAW ACROSS,DOWN
 1130 NEXT A: GO TO 1030
 1500 BORDER 6: PAPER 7: INK 9: OVER 0: CLEAR 
 1510 PRINT ''TAB 12;"Patterns"
 1520 PRINT '''"      1  Pattern 1"''"      2  Pattern 2"''"      3  Geometric Drawings"''"      4  Basic Turtle Drawing"
 1530 INPUT "Select 1, 2, 3, 4,  ";a: IF (a<1) OR (a>4) THEN RUN 
 1540 IF a=1 THEN RUN 10
 1550 IF a=2 THEN RUN 100
 1560 IF a=3 THEN RUN 300
 1570 RUN 1000
 9900 SAVE "4 Patterns" LINE 1
Scroll to Top