While sorting through random sheets of paper, I found my old CS homework. It was from a more innocent time of my freshman year. Where things seemed so new and I was so determined that I would succeed in these challenges.

Sniff, those easy days of programming…

All this just to switch the pronuns in a sentence!
(define (switch s)
(cond
((empty? s) \'())
((equal? (first s) \’you) (sentence \’i (switch-rest (butfirst s))))

(else (sentence (first s) (switch-rest (butfirst s))))))

(define (switch-rest s)
(cond
(empty? s) \'()
(equal? (first s) \’i) (sentence \’you (switch-rest (butfirst s))))

(else (sentence (first s) (switch-rest (butfirst s))))))

> (switch \'(you told me that I should wake you up))
(i told you you should wake me up)

2 thoughts on “

  1. lissssssssp. i should take some time and learn some more of that interesting language.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.