Random Fan

Date: 198x
Type: Program
Platform(s): TS 2068
Tags: Graphics

Draws random, fan-like patterns on the screen.

Content

Appears On

Capital Area Timex Sinclair User Group’s Library Tape.

Related Products

Related Articles

Related Content

Image Gallery

Random Fan

Source Code

    1 REM fan
   40 CLS 
   50 PAPER 7
   80 GO SUB 600
  110 LET x=0: LET y=0: LET q=25: LET z=0
  120 RANDOMIZE 
  130 INK 2
  140 FOR x=5 TO 250 STEP 4
  150 GO SUB 300: NEXT x
  160 FOR y=5 TO 170 STEP 4
  170 GO SUB 300: NEXT y
  180 FOR x=250 TO 5 STEP -4
  190 GO SUB 300: NEXT x
  200 FOR y=170 TO 5 STEP -4
  210 GO SUB 300: NEXT y
  220 GO TO 140
  310 LET xb=250-x: LET yb=170-y
  320 LET xe=x: LET ye=y
  330 GO SUB 400
  340 LET z=z+1: IF z>=q THEN LET z=0
  350 LET q=INT (RND*50)
  360 LET c=INT (RND*7)
  370 INK c
  380 RETURN 
  410 LET a=xe-xb
  420 LET b=ye-yb
  430 LET q=SQR (a*a+b*b)
  440 LET ux=a/q
  450 LET uy=b/q
  460 FOR l=0 TO q STEP 4
  470 LET x=xb+l*ux
  480 LET y=yb+l*uy
  490 PLOT x,y
  500 NEXT l
  510 RETURN 
  610 PLOT 0,0
  620 DRAW 255,0
  630 DRAW 0,175
  640 DRAW -255,0
  650 DRAW 0,-175
  660 RETURN 

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

People

No people associated with this content.

Scroll to Top