99 bottles of beer: Difference between revisions

Content added Content deleted
(Add bruijn)
(Fix ordering)
Line 1,445: Line 1,445:
p "One bottle of beer on the wall, one bottle of beer!"
p "One bottle of beer on the wall, one bottle of beer!"
p "Take one down, pass it around, no more bottles of beer on the wall."</syntaxhighlight>
p "Take one down, pass it around, no more bottles of beer on the wall."</syntaxhighlight>

=={{header|Bruijn}}==
<syntaxhighlight lang="bruijn">
:import std/Combinator .
:import std/Number .
:import std/String .

main y [[rec]] (+99)
rec =?0 case-end case-rec
case-rec n ++ t1 ++ n ++ t2 ++ t3 ++ n ++ t1 ++ "\n" ++ (1 --0)
n number→string 0
t1 " bottles of beer on the wall\n"
t2 " bottles of beer\n"
t3 "Take one down, pass it around\n"
case-end empty
</syntaxhighlight>


=={{header|BQN}}==
=={{header|BQN}}==
Line 1,462: Line 1,478:


Then, the two folds join all the individual lines together.
Then, the two folds join all the individual lines together.

=={{header|Bruijn}}==
<syntaxhighlight lang="bruijn">
:import std/Combinator .
:import std/Number .
:import std/String .

main y [[rec]] (+99)
rec =?0 case-end case-rec
case-rec n ++ t1 ++ n ++ t2 ++ t3 ++ n ++ t1 ++ "\n" ++ (1 --0)
n number→string 0
t1 " bottles of beer on the wall\n"
t2 " bottles of beer\n"
t3 "Take one down, pass it around\n"
case-end empty
</syntaxhighlight>


=={{header|C}}==
=={{header|C}}==