We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I seemed to have thought about it differently. I saw each triangle a square where each coordinate is colored 1 if (c<=r) and 0 if (c>r). If you add a modulo function over powers of two, you can then generate each succesively smaller pattern. If you multiply them all together you end up with a single function that you then can apply over the range of rows and columns, drop the odd rows, pretty this up into a string and then print it out.
Functions and Fractals: Sierpinski triangles
You are viewing a single comment's thread. Return to all comments →
I seemed to have thought about it differently. I saw each triangle a square where each coordinate is colored 1 if (c<=r) and 0 if (c>r). If you add a modulo function over powers of two, you can then generate each succesively smaller pattern. If you multiply them all together you end up with a single function that you then can apply over the range of rows and columns, drop the odd rows, pretty this up into a string and then print it out.
haskell:
`