! Copyright (C) 2011 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: combinators combinators.smart io kernel math math.parser
-math.ranges sequences ascii ;
+USING: ascii combinators combinators.smart io kernel math
+math.parser math.ranges sequences splitting ;
IN: 99-bottles
: bottles ( n -- number string )
[ bottles "of beer.\nTake one down, pass it around," ]
[ 1 - bottles [ >lower ] dip "of beer on the wall." ]
} cleave
- ] output>array unwords print nl ;
+ ] output>array join-words print nl ;
: last-verse ( -- )
"No more bottles of beer on the wall, no more bottles of beer." print