<commit_before>! Copyright (C) 2011 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: ascii combinators combinators.smart io kernel math
math.parser math.ranges sequences splitting ;
IN: 99-bottles

: bottles ( n -- number string )
    [ dup 0 > [ number>string ] [ drop "No more" ] if ]
    [ 1 = not "bottles" "bottle" ? ] bi ;

: verse ( n -- )
    [
        {
            [ bottles "of beer on the wall," ]
            [ bottles "of beer.\nTake one down, pass it around," ]
            [ 1 - bottles [ >lower ] dip "of beer on the wall." ]
        } cleave
    ] output>array join-words print nl ;

: last-verse ( -- )
    "No more bottles of beer on the wall, no more bottles of beer." print
    "Go to the store and buy some more, 99 bottles of beer on the wall." print ;

: 99-bottles ( -- )
    99 [1..b] [ verse ] each last-verse ;

MAIN: 99-bottles<commit_msg>99-bottles: i got 99 bottles from 99..1<commit_after>! Copyright (C) 2011 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: ascii combinators combinators.smart io kernel math
math.parser math.ranges sequences splitting ;
IN: 99-bottles

: bottles ( n -- number string )
    [ dup 0 > [ number>string ] [ drop "No more" ] if ]
    [ 1 = not "bottles" "bottle" ? ] bi ;

: verse ( n -- )
    [
        {
            [ bottles "of beer on the wall," ]
            [ bottles "of beer.\nTake one down, pass it around," ]
            [ 1 - bottles [ >lower ] dip "of beer on the wall." ]
        } cleave
    ] output>array join-words print nl ;

: last-verse ( -- )
    "No more bottles of beer on the wall, no more bottles of beer." print
    "Go to the store and buy some more, 99 bottles of beer on the wall." print ;

: 99-bottles ( -- )
    99 1 [a..b] [ verse ] each last-verse ;

MAIN: 99-bottles
{'fraction_non_alphanumeric': 0.12693156732891833, 'fraction_numerical': 0.023730684326710817, 'mean_word_length': 2.2666666666666666, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4803993', 'n_tokens_mistral': 627, 'n_tokens_neox': 588, 'n_words': 222}