48
votes
31
votes
Computer Generated Cracked Soil
Mathematica
A Voronoi diagram looks like this drawing, from Wikipedia, showing 19 cells, each containing a single seed point. A cell consists of the subregion of points which the respective ...
30
votes
Draw the Devil's Staircase
Hexagony, 217 bytes
This was immensely fun. Thank you for posting this challenge.
Full disclosure: The language (Hexagony) did not exist at the time this challenge was posted. However, I did not ...
29
votes
Create an "H" from smaller "H"s
Wolfram Language (Mathematica), 46 bytes
Nest[ArrayFlatten@{r={#,0,#},{#,#,#},r}&,1,#]&
Returns a 2d array of 0s and <...
28
votes
Accepted
Gasket Weaving - draw a Sierpiński knot
Ruby, 1168 932
Corrected a mistake from last night, more golfing to do after clarifying.
This is (currently) a full program that accepts a number from stdin and outputs an ...
26
votes
Computer Generated Cracked Soil
Java
I used an approach based on recursive Voronoi diagrams. The outputs doesn't look very realistic, but I guess they're okay.
Here are some example images (resized to 250x250 so that it doesn't ...
21
votes
Generate TeX to typeset Sierpinski Triangle Fractal
Python 2, 32 bytes
exec"print'x'"+".join('{^_}')"*5
Try it online!
21
votes
Create an "H" from smaller "H"s
Canvas, 14 12 bytes
H;[⌐⌐∔*×∔;3*+
Try it here!
Explanation:
...
19
votes
Create an "H" from smaller "H"s
MATL, 12 11 bytes
t:"[ACA]BX*
Given input n, this outputs a matrix containing 0 and <...
16
votes
Create an "H" from smaller "H"s
Stax, 16 15 bytes
╛c_mê║6{│◙ÖmπV"
Run and debug it
This is the ascii representation of the program with comments. This program builds up the H sideways, and ...
15
votes
15
votes
Generate TeX to typeset Sierpinski Triangle Fractal
plain TeX, 29 bytes
\def~#1x{{#1x_#1x^#1x}}~~~~~x
That outputs what others have output. But if we need the code to be compilable it would be 6 bytes more
...
13
votes
Is it within the Cantor set?
Mathematica, 54 bytes
If[Last@#===1,Most@#,#]&@RealDigits[#,3][[1]]~FreeQ~1&
Unnamed function taking a fraction x/y ...
13
votes
13
votes
Accepted
The strange attraction of the logistic map
MATL, 32 30 28 27 bytes
4 bytes saved thanks to @Luis
3$:0:.01:1!i:"tU-y*]'.'3$XG
The input format is r1, ...
13
votes
Drawing the Peano curve
GFA Basic 3.51 (Atari ST), 156 134 124 bytes
A manually edited listing in .LST format. All lines end with CR, including the last one.
...
12
votes
Draw A Sierpinski Triangle
80x86 Code / MsDos - 10 Bytes
As a sizecoder specialized for very tiny intros on MsDos i managed to come up with a program that occupies only 10 bytes.
in hex:
...
12
votes
Computer Generated Cracked Soil
Python 3 (using Kivy library and GLSL)
First generated image
Python code:
...
12
votes
12
votes
Generate a Padovan Spiral
Mathematica, 119 108 bytes
Thanks to Martin Ender for saving 11 bytes!
...
12
votes
Draw this fractal generated by applying Newton's method to cosh(x) - 1
Desmos, 401 375 357 353 bytes
-26 bytes thanks to @aiden-chow
-18 bytes thanks to flexabrotnt#1409
...
11
votes
Create an "H" from smaller "H"s
Ruby, 72 bytes
Output is a list of strings, one string per line.
f=->n{n<1?[?H]:[*a=(x=f[n-1]).map{|i|i+' '*i.size+i},*x.map{|i|i*3},*a]}
Try it online!
11
votes
Create an "H" from smaller "H"s
APL (Dyalog Classic), 14 bytes
×/¨∘.≥⍨2|,⍳⎕⍴3
Try it online!
⎕ evaluated input n
,⍳⎕⍴3 ...
10
votes
10
votes
10
votes
It's factors all the way down!
Python 3.5, 331 309 308 306 304 bytes
It took quite a bit of messing with the spacing of the polygons (and the specification, too, to be honest) to get this answer to work, but I finally did it and ...
10
votes
Accepted
Make Some Snow!
Haskell, 308 300 299 bytes
Edits:
-4 bytes: Changing zipWith(+) to zipWith(-) and adjusting encodings and offsets got rid of ...
10
votes
Create an "H" from smaller "H"s
Haskell, 50 bytes
f 0=[[1]]
f n=[x++map(*c)x++x|c<-[0,1,0],x<-f$n-1]
Try it online!
Makes a grid of 0's and 1's. One character longer for spaces and H's.
...
10
votes
Drawing the Peano curve
Perl 6, 117 bytes
{map ->\y{|map {(((++$+y)%2+$++)%3**(y+$^v,*/3...*%3)??$^s[$++%2]!!'│')xx$_*3},<┌ ┐>,$_,<└ ┘>,1},^$_}o*R**3
Try it online!
0-...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
fractal × 68code-golf × 63
ascii-art × 28
graphical-output × 25
math × 8
kolmogorov-complexity × 7
image-processing × 5
geometry × 4
string × 3
number × 3
sequence × 3
popularity-contest × 3
recursion × 3
random × 2
rational-numbers × 2
decision-problem × 1
number-theory × 1
grid × 1
primes × 1
matrix × 1
binary × 1
graph-theory × 1
fastest-code × 1
source-layout × 1
path-finding × 1