4.18.2 Greatest hits from previous weeks

4.18.2.1 Generating a Sierpinski carpet
4.18.2.2 Alternatives to procedural loops and iterating over lists in Mathematica
4.18.2.1 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)

4.18.2.2 Alternatives to procedural loops and iterating over lists in Mathematica

https://mathematica.stackexchange.com/questions/7924/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)