home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / diskplot / diskplot.lbr / MANDALA.BQS / MANDALA.BAS
Encoding:
BASIC Source File  |  1985-06-17  |  1.1 KB  |  27 lines

  1. 10 CLEAR 25000 :DEFINT B-Z
  2. 15 CS$=CHR$(12) '** define clear screen
  3. 20 REM clear screen and opening message
  4. 25 PRINT CS$ :PRINT "Mandala generator"
  5. 40 PRINT "Create a (N)ew plot, (P)rint an pre-existing file or"
  6. 45 INPUT "'X' to exit program (N/P/X)";PQ$
  7. 50 IF PQ$="P" THEN GOSUB 5000 :GOTO 10
  8. 55 IF PQ$="X" THEN END ELSE IF PQ$<>"N" GOTO 40
  9. 60 PRINT :INPUT "Input radius (max of 310)";R
  10. 65 PRINT :INPUT "Input Number of divisions";D
  11. 100 DIM X(D),Y(D) :A=2*3.1416/D
  12. 110 FOR I=0 TO D
  13. 120  X(I)=R*(1+SIN(I*A))+3 :Y(I)=R*(1-COS(I*A))+3 :NEXT
  14. 460 P10=2*R+4 :P9=2*R+4 '** parms for gosub
  15. 461 GOSUB 3000 :PRINT CS$
  16. 462 CP4$=CHR$(27)+"f #"
  17. 510 FOR I=0 TO D-1 :FOR J=I+1 TO D-1
  18. 514 PRINT CP4$;
  19. 515 PRINT USING "Plotting from Point ## (### ###) to Point ## (### ###)";
  20.      I,X(I),Y(I),J,X(J),Y(J)
  21. 520 X1=X(I) :Y1=Y(I) :X2=X(J) :Y2=Y(J) :GOSUB 1000 :NEXT :NEXT
  22. 580 PRINT CHR$(7) :GOSUB 4000
  23. 600 GOSUB 5000
  24. 610 LPRINT :LPRINT TAB(34);"MANDALA"
  25. 630 LPRINT TAB(15);"Number of divisions: ";D;" Angle Size: ";360/D
  26. 670 GOTO 10
  27.