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.
stores rows in bit-vectors, and generates the next row from previous row using one of two rules: the ordinary rule, which sets bit to 1 if and only if an adjacent bit was on in the previous row, or the "restarting" rule, which places lone 1 bits below sequences that look like 001 or 100, with the sole exception of the n=5 case, for which the very last row is a restart, and the first and last bits are turned on even though they are not below a 001 or 100 sequence
Functions and Fractals: Sierpinski triangles
You are viewing a single comment's thread. Return to all comments →
common lisp solution
stores rows in bit-vectors, and generates the next row from previous row using one of two rules: the ordinary rule, which sets bit to 1 if and only if an adjacent bit was on in the previous row, or the "restarting" rule, which places lone 1 bits below sequences that look like 001 or 100, with the sole exception of the n=5 case, for which the very last row is a restart, and the first and last bits are turned on even though they are not below a 001 or 100 sequence