Hacker News new | past | comments | ask | show | jobs | submit login




And here it is in apl :)

  (width iterations) ← 127 64 ⍝ perfect size for a nice sierpinski
  
  advance ← {2|-⌿¯1 1⊖⍤0 1⊢⍵} ⍝ on a torus
  x←width⍴0 ⋄ x[⌊width÷2] ← 1
  {⎕←' ⌹'[⍵]⋄advance ⍵}⍣iterations⊢x
And the random variant (not as pretty, but still has some nice triangles):

  {⎕←' ⌹'[⍵]⋄advance ⍵}⍣iterations ?width⍴2


First time seeing .nim code in the wild! Seems like a fun/ fast language to use.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: