Skip to content

Instantly share code, notes, and snippets.

@cindywu
Created April 26, 2020 05:26
Show Gist options
  • Save cindywu/4c79c78d3c2494444e7803c4482c69a4 to your computer and use it in GitHub Desktop.
Save cindywu/4c79c78d3c2494444e7803c4482c69a4 to your computer and use it in GitHub Desktop.
crackle-pop
(define count 1)
(define (crackle-pop count n)
(cond ((and (= 0 (remainder count 3))(= 0 (remainder count 5))) (display "CracklePop\n"))
((= 0 (remainder count 3))(display "Crackle\n"))
((= 0 (remainder count 5))(display "Pop\n"))
(else (display count)(display "\n")))
(if (> n count) (crackle-pop (+ count 1) n)))
(crackle-pop count 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment