Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #|;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- HW4 #3
- Histogram.rkt by Ryan Liszewski
- (a)Prints n asterisk(s) in a line
- (b)Prints a histogram using a recursive procedure and the line in (a)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;|#
- #lang racket
- (define (line n)
- (cond ((< n 1) (newline))
- (else (display "*") (line (- n 1)))))
- (define (histogram list)
- (if (null? list) (newline)
- (begin (line (car list))
- (histogram (cdr list)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement