Pie Chart

Date: 1986
Type: Program
Platform(s): TS 2068

Pie chart with up to 18 divisions.

Appears on

Library tape from the Sinclair Computer Users Society (SINCUS).

Gallery

Pie Chart

Source Code

    5 REM pie chart                      ZX-Appeal Oct. 1986             Vancouver Sinclair UG
   10 CIRCLE 128,88,79: PLOT 128,88: DRAW 0,78
   20 LET t=0
   30 INPUT "Percentage of Circle?(-1 to end) ";p
   40 IF p=-1 THEN GO TO 200
   50 IF p=100 THEN PLOT OVER 1;128,88: DRAW OVER 1;0,70: GO TO 200
   60 IF p<0 OR p>(100-t) THEN GO TO 30
   70 LET t=t+p
   80 LET a=360*t/100
   90 PLOT 128,88: DRAW (78)*SIN (a/180*PI),(78)*COS (a/180*PI)
  100 GO TO 30
  200 PLOT 0,0: DRAW 255,0: DRAW 0,175: DRAW -255,0: DRAW 0,-175
  210 FOR t=0 TO 255 STEP 8: PLOT t,174: NEXT t
  220 FOR r=175 TO 0 STEP -8: PLOT 254,r: NEXT r
  230 FOR b=255 TO 0 STEP -8: PLOT b,1: NEXT b
  240 FOR l=0 TO 175 STEP 8: PLOT 1,l: NEXT l
  250 INPUT "Label? "; LINE a$;"Position? ";x;" ";y: IF y=32 THEN GO TO 400
  260 PRINT AT x,y;a$
  270 GO TO 250
  400 FOR t=0 TO 31: PRINT AT 0,t;" ";: NEXT t
  410 FOR r=0 TO 21: PRINT AT r,31;" ";: NEXT r
  420 FOR b=31 TO 0 STEP -1: PRINT AT 21,b;" ";: NEXT b
  430 FOR l=21 TO 0 STEP -1: PRINT AT l,0;" ";: NEXT l
  440 INPUT LINE z$
  450 PRINT AT 0,(32-LEN z$)/2;z$
  460 STOP 
 9999 CLEAR : CLS : SAVE "pie chart": BEEP 1,32: PRINT "Rewind to VERIFY.": VERIFY "": PRINT : PRINT FLASH 1;" V E R I F I E D ": BEEP .2,30

People

No people associated with this content.

Scroll to Top