5.1 improvement to sierpinski code from robby, can go live now
This commit is contained in:
parent
2880edcb8c
commit
6dccc8f059
|
@ -89,11 +89,11 @@
|
|||
(graphical-example ; ---------------------------------------------
|
||||
@code{#lang racket ; A picture
|
||||
(require 2htdp/image)
|
||||
(let sierpinski ([n 6])
|
||||
(let sierpinski ([n 8])
|
||||
(if (zero? n)
|
||||
(triangle 2 'solid 'red)
|
||||
(let ([next (sierpinski (- n 1))])
|
||||
(above next (beside next next)))))}
|
||||
(triangle 2 'solid 'red)
|
||||
(let ([t (sierpinski (- n 1))])
|
||||
(above t (beside t t)))))}
|
||||
@desc{The @elemcode{2htdp/image} library provides easy-to-use functions
|
||||
for constructing images, and DrRacket can display an image result as
|
||||
easily as it can display a number result. In this case, a
|
||||
|
|
Loading…
Reference in New Issue
Block a user