--- title: "Snowflakes" type: "article" slug: "snowflakes" url: "http://localhost/article/snowflakes/" markdown_url: "http://localhost/article/snowflakes.md" published_at: "2022-10-07T12:22:45+00:00" modified_at: "2026-08-01T13:54:02+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/10/20230809-041324.jpg" excerpt: "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…" category: - name: "CATS Newsletter" slug: "cats-newsletter" taxonomy: "category" url: "http://localhost/category/periodicals/cats-newsletter/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Roald Schrack" slug: "roald-schrack" taxonomy: "indiv" url: "http://localhost/indiv/roald-schrack/" publication_r: id: 35941 title: "CATS Newsletter" type: "periodical" url: "http://localhost/periodical/cats-newsletter/" authors: "Roald Schrack" authors_r: - name: "Roald Schrack" slug: "roald-schrack" taxonomy: "indiv" url: "http://localhost/indiv/roald-schrack/" volume: "3" issue: "5" issues_articles: - id: 39604 title: "CATS v3 n5" type: "issue" url: "http://localhost/issue/cats-v3-n5/" pages: "12" pubdate: "August 1985" archive_link: false --- # Snowflakes 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](https://www.nature.com/articles/314324b0). ``` 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=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 ``` [![Image](http://localhost/wp-content/uploads/2022/11/CATS-v3-n5-Aug-1985_0011_a.jpeg)](http://localhost/wp-content/uploads/2022/11/CATS-v3-n5-Aug-1985_0011_a.jpeg) [![Image](http://localhost/wp-content/uploads/2022/11/CATS-v3-n5-Aug-1985_0011_b.jpeg)](http://localhost/wp-content/uploads/2022/11/CATS-v3-n5-Aug-1985_0011_b.jpeg)