Snowflakes

Authors

Publication

Pub Details

Date

Pages

See all articles from CATS v3 n5

Here is a code for the 2068 that will produce snowflake-like patterns. Each run will produce a different pattern. The dendrites are produced on lines 80 to 160. The pattern is then developed from line 170 on, with the subroutine starting at line 300 making the copies of the different angles. The code will keep adding to the complexity of the pattern until you stop it with a break instruction. You can then do a copy instruction to make a print of your results.

The 2040 prints with pixels that are 20% narrower than the screen pixel, so you will not get a symmetric picture on the screen.

If you would rather have a symmetric print, then change the value of a in line 15 to 1.2 and see what happens. The examples show the value of a that was used.

If you are interested in the origin of snowflake symmetry, you should read my letter to Nature, volume 314, 28 March 1985, page 324.

10 LET YM=0
15 LET A=1
20 RANDOMIZE
30 DIM P(12,40)
40 LET Y=1+INT ((YM+3)*RND)
50 FOR N=1 TO 12
60 IF P(N,Y)=0 THEN GO TO 80
70 NEXT N
80 IF Y<YM THEN GO TO 170
85 IF YM>=29 THEN GO TO 40
90 LET YM=YM+1
100 LET SAV=Y
110 LET Y=YM
120 LET X=0
130 GO SUB 300
140 GO SUB 400
150 LET Y=SAV
160 GO TO 80
170 LET P(N,Y)=1
180 LET X=N
190 LET T=0
200 GO SUB 400
210 GO SUB 300
220 IF T=0 THEN GO TO 240
230 GO TO 40
240 LET T=1
250 LET X=-X
260 GO TO 200
300 LET U=X
302 LET V=Y
304 FOR I=1 TO 5
310 LET G=I*PI/3
320 LET GC=COS G
330 LET GS=SIN G
360 LET X=A*INT (U*GC+V*GS)
370 LET Y=INT (V*GC-U*GS)
380 GO SUB 400
390 NEXT I
392 LET X=U
394 LET Y=V
396 RETURN
400 PLOT 2*X+128,2*Y+87
410 PLOT 2*X+129,2*Y+87
420 PLOT 2*X+128,2*Y+88
430 PLOT 2*X+129,2*Y+88
440 RETURN

Products

 

Downloadable Media

 
Scroll to Top