remove broken demos from mztake (fix later)

svn: r7076
This commit is contained in:
Greg Cooper 2007-08-10 02:12:14 +00:00
parent 2991f2a44a
commit fd853a0fcc
5 changed files with 0 additions and 74 deletions

View File

@ -1,35 +0,0 @@
(require (lib "animation.ss" "frtime")
(lib "mztake.ss" "mztake")
(lib "useful-code.ss" "mztake")
(as-is mzscheme assoc))
(define/bind (loc "random.ss" '(loop _)) x)
(define (assoc-inc l x)
(let ([filtered (filter (lambda (y) (not (eq? x (first y)))) l)]
[new-pair (let ([r (assoc x l)])
(if r `(,x ,(add1 (second r)))
`(,x 1)))])
(cons new-pair filtered)))
(define histogram
(accum-b ((changes x) . ==> . (lambda (x) (lambda (h) (assoc-inc h x))))
empty))
(define x-scale 15)
(define y-scale 20)
(define (make-histogram-rectangle p)
(let ([bin (first p)]
[count (second p)])
(make-rect (make-posn (* bin x-scale) 0)
x-scale (* count y-scale)
"blue")))
(define rectangles (map make-histogram-rectangle histogram))
(display-shapes rectangles)
(define largest-bin (apply max (cons 0 (map second histogram))))
(set-running! (< largest-bin 18))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

View File

@ -1,5 +0,0 @@
(module random mzscheme
(define (run)
(let loop ([x (random 20)])
(loop (random 20))))
(run))

View File

@ -1,26 +0,0 @@
(require (lib "animation.ss" "frtime")
(lib "useful-code.ss" "mztake"))
(require (lib "mztake.ss" "mztake"))
(define/bind (loc "sine.ss" '(if _) ) x sin-x)
(define (pick-cute-color x y)
(if (< 200 y)
(if (< 200 x) "blue" "darkblue")
(if (< 200 x) "red" "darkred")))
(define (make-cute-circle x y)
(make-circle (make-posn x y)
5
(pick-cute-color x y)))
(display-shapes
(list* (make-line (make-posn 0 200) (make-posn 400 200) "gray")
(make-line (make-posn 200 0) (make-posn 200 400) "gray")
(let ([x (+ 200 x)]
[sin-x (+ 200 (* 100 sin-x))])
(history-b (changes (make-cute-circle x sin-x)) 50))))
(set-running! #t)

View File

@ -1,8 +0,0 @@
(module sine mzscheme
(define (run)
(let loop ([x -200])
(let ([sin-x (sin (/ x 20.0))])
(if (x . < . 200)
(loop (add1 x))
(loop -200)))))
(run))