Skip to main content
Bounty Awarded with 50 reputation awarded by CommunityBot
edited body
Source Link
Martin Ender
  • 198.3k
  • 67
  • 455
  • 999

enter image description hereenter image description hereenter image description hereenter image description here

enter image description hereenter image description here

enter image description hereenter image description here

added 23 characters in body
Source Link
Martin Ender
  • 198.3k
  • 67
  • 455
  • 999

Mathematica, 413409 bytes

{n,p}=Input[];Clear@f;_~f~_=0;0~f~0=1;r=RandomInteger;For[i=0=Input[];m=999;Clear@f;_~f~_=0;0~f~0=1;r=RandomInteger;For[i=0,i<999i<m,++i,For[x=999;y=0For[x=m;y=0,f[x+1,y]+f[x-1,y]+f[x,y+1]+f[x,y-1]<1,a=b=-999;While[x+a<0||y+b<0||m;While[x+a<0||y+b<0||(y+b)/(x+a)>Tan[Pi/6],a=-r@1;b=r@2-1];x+=a;y+=b];x~f~y=1];Graphics[{White,g=Point/@Join@@{c=Cases[Join@@Table[{i,j}-1,{i,100m},{j,100m}],{i_,j_}/;i~f~j>0],c.{{1,0},{0,-1}}},Array[Rotate[g,Pi#/3,{0,0}]&,6]},Background->Black,ImageSize->n*p,ImageMargins->n(1-p)/2]
{n,p}=Input[];
m = 999;
ClearAll@f;
_~f~_ = 0;
0~f~0 = 1;
r = RandomInteger;
For[i = 0, i < 999m, ++i,
  For[x = 999;m; y = 0, 
   f[x + 1, y] + f[x - 1, y] + f[x, y + 1] + f[x, y - 1] < 1,
   a = b = -999;m;
   While[x + a < 0 || y + b < 0 || (y + b)/(x + a) > Tan[Pi/6],
    a = -r@1;
    b = r@2 - 1
    ];
   x += a;
   y += b
   ];
  x~f~y = 1
  ];
Graphics[
 {White, g = 
   Point /@ 
    Join @@ {c = 
       Cases[Join @@ Table[{i, j} - 1, {i, 100m}, {j, 100m}], {i_, j_} /;
          i~f~j > 0], c.{{1, 0}, {0, -1}}}, 
  Array[Rotate[g, Pi #/3, {0, 0}] &, 6]},
 Background -> Black,
 ImageSize -> n*p,
 ImageMargins -> n (1 - p)/2
 ]

It takes something like half a minute to generate a snowflake with the given parameters. You can speed it up by replacingchanging the value of m from 999s with to 99s, but then the result looks a bit sparse. Likewise, you can crank up the quality by using larger numbers, but then it'll take agesvery long.

enter image description hereenter image description here enter image description hereenter image description here enter image description hereenter image description here enter image description hereenter image description here enter image description hereenter image description here enter image description hereenter image description here enter image description hereenter image description here

Mathematica, 413 bytes

{n,p}=Input[];Clear@f;_~f~_=0;0~f~0=1;r=RandomInteger;For[i=0,i<999,++i,For[x=999;y=0,f[x+1,y]+f[x-1,y]+f[x,y+1]+f[x,y-1]<1,a=b=-999;While[x+a<0||y+b<0||(y+b)/(x+a)>Tan[Pi/6],a=-r@1;b=r@2-1];x+=a;y+=b];x~f~y=1];Graphics[{White,g=Point/@Join@@{c=Cases[Join@@Table[{i,j}-1,{i,100},{j,100}],{i_,j_}/;i~f~j>0],c.{{1,0},{0,-1}}},Array[Rotate[g,Pi#/3,{0,0}]&,6]},Background->Black,ImageSize->n*p,ImageMargins->n(1-p)/2]
{n,p}=Input[];
ClearAll@f;
_~f~_ = 0;
0~f~0 = 1;
r = RandomInteger;
For[i = 0, i < 999, ++i,
  For[x = 999; y = 0, 
   f[x + 1, y] + f[x - 1, y] + f[x, y + 1] + f[x, y - 1] < 1,
   a = b = -999;
   While[x + a < 0 || y + b < 0 || (y + b)/(x + a) > Tan[Pi/6],
    a = -r@1;
    b = r@2 - 1
    ];
   x += a;
   y += b
   ];
  x~f~y = 1
  ];
Graphics[
 {White, g = 
   Point /@ 
    Join @@ {c = 
       Cases[Join @@ Table[{i, j} - 1, {i, 100}, {j, 100}], {i_, j_} /;
          i~f~j > 0], c.{{1, 0}, {0, -1}}}, 
  Array[Rotate[g, Pi #/3, {0, 0}] &, 6]},
 Background -> Black,
 ImageSize -> n*p,
 ImageMargins -> n (1 - p)/2
 ]

It takes something like a minute to generate a snowflake with the given parameters. You can speed it up by replacing the 999s with 99s, but then the result looks a bit sparse. Likewise, you can crank up the quality by using larger numbers, but then it'll take ages.

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

Mathematica, 409 bytes

{n,p}=Input[];m=999;Clear@f;_~f~_=0;0~f~0=1;r=RandomInteger;For[i=0,i<m,++i,For[x=m;y=0,f[x+1,y]+f[x-1,y]+f[x,y+1]+f[x,y-1]<1,a=b=-m;While[x+a<0||y+b<0||(y+b)/(x+a)>Tan[Pi/6],a=-r@1;b=r@2-1];x+=a;y+=b];x~f~y=1];Graphics[{White,g=Point/@Join@@{c=Cases[Join@@Table[{i,j}-1,{i,m},{j,m}],{i_,j_}/;i~f~j>0],c.{{1,0},{0,-1}}},Array[Rotate[g,Pi#/3,{0,0}]&,6]},Background->Black,ImageSize->n*p,ImageMargins->n(1-p)/2]
{n,p}=Input[];
m = 999;
ClearAll@f;
_~f~_ = 0;
0~f~0 = 1;
r = RandomInteger;
For[i = 0, i < m, ++i,
  For[x = m; y = 0, 
   f[x + 1, y] + f[x - 1, y] + f[x, y + 1] + f[x, y - 1] < 1,
   a = b = -m;
   While[x + a < 0 || y + b < 0 || (y + b)/(x + a) > Tan[Pi/6],
    a = -r@1;
    b = r@2 - 1
    ];
   x += a;
   y += b
   ];
  x~f~y = 1
  ];
Graphics[
 {White, g = 
   Point /@ 
    Join @@ {c = 
       Cases[Join @@ Table[{i, j} - 1, {i, m}, {j, m}], {i_, j_} /;
          i~f~j > 0], c.{{1, 0}, {0, -1}}}, 
  Array[Rotate[g, Pi #/3, {0, 0}] &, 6]},
 Background -> Black,
 ImageSize -> n*p,
 ImageMargins -> n (1 - p)/2
 ]

It takes something like half a minute to generate a snowflake with the given parameters. You can speed it up by changing the value of m from 999 to 99, but then the result looks a bit sparse. Likewise, you can crank up the quality by using larger numbers, but then it'll take very long.

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

added 254 characters in body
Source Link
Martin Ender
  • 198.3k
  • 67
  • 455
  • 999

And here are two animations of the Brownian tree growing (10 particles per wedge per frame):

enter image description hereenter image description here

And here are two animations of the Brownian tree growing (10 particles per wedge per frame):

enter image description hereenter image description here

deleted 3 characters in body
Source Link
Martin Ender
  • 198.3k
  • 67
  • 455
  • 999
Loading
Source Link
Martin Ender
  • 198.3k
  • 67
  • 455
  • 999
Loading