Guest User

Untitled

a guest
Sep 9th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.47 KB | None | 0 0
  1. (defun greenbottles (x)
  2.   (cond
  3.    ((> x 0) (format t "~A green bottles sitting on the wall~%~A green bottles sitting on the wall~%and if one green bottle should accidentally fall there'll be ~A green bottles left on the wall ~%" x x (- x 1)) (greenbottles (- x 1)))
  4.    (t (format t "there are no more green bottles sitting on the wall"))))
  5.  
  6.  
  7. (cond
  8.  (*args* (greenbottles (parse-integer (car *args*))))
  9.  (t (format t "please enter how many bottles~%")(greenbottles (read))))
Advertisement
Add Comment
Please, Sign In to add comment