Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; (check-star) consumes a Str S and returns "****" if it is a 4-lettered string
- ;; else returns the same string
- ;; check-star : Str -> Str
- (define (check-star S)
- (cond
- [(equal? (string-length S) 4) "****"]
- [else S]))
- ;; (censor L) consumes a (listof Str) L and returns a Str with all list members
- ;; combined to form a single sentence and every 4-letter member
- ;; changed to "****"
- ;; censor : (listof Str) -> Str
- (define (censor L)
- (join (map check-star L)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement