Jump to content

99 bottles of beer: Difference between revisions

Fix ordering
(Add bruijn)
(Fix ordering)
Line 1,445:
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>
 
=={{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}}==
Line 1,462 ⟶ 1,478:
 
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}}==
55

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.