Advertisement
nicolas42

99 bottles of beer

Oct 26th, 2012
2,661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
REBOL 0.56 KB | None | 0 0
  1. rebol []
  2.  
  3. a: [
  4.     99  ;1
  5.     " bottles of beer" ;2
  6.     " on the wall"  ;3
  7.     ", "    ;4
  8.     ".^/"   ;5
  9.     "Take one down and pass it around, "    ;6
  10.     98  ;7
  11.     " bottle of beer"   ;8
  12.     "no more"   ;9
  13.     "No more"   ;10
  14.     "Go to the store and buy some more, "   ;11
  15.     99  ;12
  16. ]
  17.  
  18. b: [
  19.     [1 2 3 4  1 2 5  6 7 2 3 5] ;97 times
  20.     [1 2 3 4  1 2 5  6 7 8 3 5]
  21.     [1 8 3 4  1 8 5  6 9 2 3 5]
  22.     [10 2 3 4  9 2 5  11 12 2 3 5]
  23. ]
  24.  
  25. drink: does [prin newline  a/1: a/1 - 1  a/7: a/7 - 1]
  26. loop 97 [foreach n sequence/1 [prin pick a n] drink ]  
  27. foreach seq next sequence [foreach n seq [prin pick a n] drink ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement