PasteRack.org
Paste # 93445
2019-03-11 22:47:12

Forked from paste # 8953.

Fork as a new paste.

Paste viewed 91 times.


Embed:

Sierpinski

  1. #lang racket  ; A picture
  2. (require 2htdp/image)
  3. (let sierpinski ([n 4])
  4.   (if (zero? n)
  5.     (triangle 2 'solid 'red)
  6.     (let ([t (sierpinski (- n 1))])
  7.       (freeze (above t (beside t t))))))

=>

image