Post History
Scala, 242 bytes _=>99 to(1,-1)map{b=>s"${w(b)} on the wall, ${w(b)}. \n${if(b>1)"Take one down and pass it around"else "Go to the store and buy some more"}, ${w((b+97)%99+1)} on the w...
Answer
#2: Post edited
# [Scala], 244 bytes- <!-- language-all: lang-scala -->
_=>{def w(b:Int)=s"$b bottle${if(b>1)"s"else ""} of beer"99 to(1,-1)map{b=>s"${w(b)} on the wall, ${w(b)}.${if(b>1)"Take one down and pass it around"else"Go to the store and buy some more"}, ${w((b+97)%99+1)} on the wall."}mkString ""}[Try it online!][TIO-krzgxxan]- [Scala]: http://www.scala-lang.org/
[TIO-krzgxxan]: https://tio.run/##VY/BasMwEETv/opBpCCRNNSn4oANOYUcemqPhiLF69SNvDKWUjcYf7sr3EDpcYeZ91h/0lbPznzSKeBFNwz6DsSVx77rMCZf2qLeYc835AVeQ9/wGfn8nhdjRTUGaXZHDir3YmVgXAiWVmNTS1OkSnhB1hOEmOBqGKJeJFmG4GS6eUxVq7vR5EWcjpGjYokRPgiDtnaDe7hFyX/EN32hWCNUbmBortBp79EE6N5duVqEiTi4KFlYPrielqK53uBdS2hjIqZfgTTr7Fk9ZNk6/e/fiqm93N8VJZcsprmLV5C1fFIqmeYf "Scala – Try It Online"
- # [Scala], 242 bytes
- <!-- language-all: lang-scala -->
- _=>99 to(1,-1)map{b=>s"${w(b)} on the wall, ${w(b)}.
- ${if(b>1)"Take one down and pass it around"else
- "Go to the store and buy some more"}, ${w((b+97)%99+1)} on the wall."}mkString "
- "
- def w(b:Int)=s"$b bottle${if(b>1)"s"else ""} of beer"
- [Try it online!][TIO-krzgz8kr]
- [Scala]: http://www.scala-lang.org/
- [TIO-krzgz8kr]: https://tio.run/##VY6xasMwFEV3f8VFpCCRNNRTccCGTCFDp3Y0FCl@Tt3IT8ZS6gbjb3eFGyhdL5dzjj9pq2dnPukU8KIbBn0H4spj33UYky9tUe@w5xvyAq@hb/iMfH7PiyxDcDLdPKaq1d1o8sKL1ThIoyY4RvggDNraDe7jFiWvxqaWpkiVeNMXijdC5QaG5gqd9h5NgO7dlStB1lMiDi5KFpYPrqflaK43eNcS2riI6VcgzTp7Vg9Ztk7/@7diai/3blFyySKpqEZM2h05qDxGGxgXgqW/Or/oIURE1TBEvZi7iAiylk9KJdP8Aw "Scala – Try It Online"
#1: Initial revision
# [Scala], 244 bytes <!-- language-all: lang-scala --> _=>{def w(b:Int)=s"$b bottle${if(b>1)"s"else ""} of beer" 99 to(1,-1)map{b=>s"${w(b)} on the wall, ${w(b)}. \n${if(b>1)"Take one down and pass it around"else "Go to the store and buy some more"}, ${w((b+97)%99+1)} on the wall."}mkString "\n\n"} [Try it online!][TIO-krzgxxan] [Scala]: http://www.scala-lang.org/ [TIO-krzgxxan]: https://tio.run/##VY/BasMwEETv/opBpCCRNNSn4oANOYUcemqPhiLF69SNvDKWUjcYf7sr3EDpcYeZ91h/0lbPznzSKeBFNwz6DsSVx77rMCZf2qLeYc835AVeQ9/wGfn8nhdjRTUGaXZHDir3YmVgXAiWVmNTS1OkSnhB1hOEmOBqGKJeJFmG4GS6eUxVq7vR5EWcjpGjYokRPgiDtnaDe7hFyX/EN32hWCNUbmBortBp79EE6N5duVqEiTi4KFlYPrielqK53uBdS2hjIqZfgTTr7Fk9ZNk6/e/fiqm93N8VJZcsprmLV5C1fFIqmeYf "Scala – Try It Online"