F#, 377 bytes
open System.Text.RegularExpressions
let s=System.String.IsNullOrWhiteSpace>>not
let m f=Regex.Match((f+"").Split[|'\r';'\n'|]|>Seq.filter s|>Seq.take 8|>Seq.reduce(fun a z->a+z.Trim()), ".*n (.*) c.*\.([0-9]+) (.*) \(l.* (.*),.*a (.*) o.*\.(?:(S.*)|W.*(E.*)).*.T.*\((.*) .*\).").Gro...
99 bottles of beer on the wall, 99 bottles of beer
Take one down and pass it around, 98 bottles of beer on the wall.98 bottles of beer on the wall, 98 bottles of beer
Take one down and pass it around, 97 bottles of beer on the wall.97 bottles of beer on the wall, 97 bottles of beer
Take one down and pass it around, 96 bottles of beer on the wall.96 bottles of beer on the wall, 96 bottles of beer
Take one down and pass it around, 95 bottles of beer on the wall.95 bottles of beer on the wall, 95 bottles of beer
Haskell, 228 bytes
o=" of beer on the wall"
a 1="1 bottle"
a n=shows n" bottles"
b 1="Go to the store and buy some more, "++a 99
b n="Take one down and pass it around, "++a(n-1)
f=[99,98..1]>>= \n->[a n,o,", ",a n," of beer.\n",b n,o,".\n\n"]>>=id
Function f returns a string with the lyrics.
I can't seem to find any HQ9+ interpreter anywhere that prints the lyrics exactly as shown in the question anyway. Can you point me to one? Otherwise any variant, no matter how TC, is going to be invalid IMO.
@flawr The following code is then interpreted as BrainFuck. sounds like BF in the source code. read input and execute as a brainfuck program. sounds like BF from STDIN. Not sure if I'm missing something.
TI-BASIC, 7 bytes
stdDev(augment(Ans,{mean(Ans
I borrowed the algorithm to get population standard deviation from sample standard deviation from here.
The shortest solution I could find without augment( is 9 bytes:
stdDev(Ans√(1-1/dim(Ans
If I'd only marked it as CW from the start, instead of trying to find my own shorter solution...
I was hoping for a Chef answer but I guess a guy in the comments was working on one and only got one piece of the spec implemented and it was already too long for an SE post.
I'm tempted to call this a dupe of HQ9+ interpreter because, as Geobits noted, it's a subtask, though the required text is very (very) slightly different.
Rosetta Code collects solutions to standard programming exercises in hundreds of programming languages. However, it focuses on "good" or idiomatic solutions in those languages. I'm not aware of a similar catalogue from a golfing perspective. Is PPCG capable of fulfilling that role? Do we have cha...