Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. sing: function [input][
  2. input: copy input
  3. n: orig-num: first input
  4. sing-verse: func [n][
  5. print [
  6. n =phrase "on the wall," n =phrase ".^/"
  7. "Take one down and pass it around,"
  8. either n > 1 [n - 1]["no more"] =phrase "on the wall.^/"
  9. ]
  10. ]
  11. sing-last-verse: does [
  12. print [
  13. "No more" =phrase "on the wall, no more" =phrase ".^/"
  14. "Go to the store and buy some more," orig-num =phrase "on the wall."
  15. ]
  16. ]
  17.  
  18. phrase: [copy =phrase to end]
  19. rule: [
  20. set n quote 0 phrase (sing-last-verse)
  21. | change set n integer! (n - 1) phrase (sing-verse n)
  22. ]
  23. while [n > 0][parse input rule]
  24. ]
  25. sing [99 bottles of beer]
  26. sing [33 carafes of wine]
  27. sing [13 flagons of ale]
  28. sing [17 vials of blood] ; for vampires
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement