Generating a Sierpinski carpet
Alternatives to procedural loops and iterating over lists in Mathematica
Generating a Sierpinski carpet https://mathematica.stackexchange.com/questions/22052/generating-a-sierpinski-carpet
I am trying to draw a Sierpinski_carpet. I have code that works, but I think there is a more elegant way to do than my way. Maybe I couls use Tuples or Permutations or some similar function to ...
- asked by chyaong (46 votes), answered by Mr.Wizard (75 votes)
Alternatives to procedural loops and iterating over lists in Mathematica
While there are some cases where a For loop might be reasonable, it's a general mantra one I subscribe to myself that "if you are using a For loop in Mathematica, you are probably doing it wrong". ...
- asked by Mr.Wizard (154 votes), answered by Mr.Wizard (104 votes)