Skip to content

Instantly share code, notes, and snippets.

@stephenmcgruer
stephenmcgruer / gist:858539
Created March 7, 2011 14:03
99 Bottles of Beer, the (Compiling Techniques version of) Small-C way.
// Welcome to hell... and the reason
// for the ability to embed variables
// in strings. Yes, this is effectively the
// same as just writing the damn thing out.
// And yes, I did generate this code - I'm not
// that insane.
outputBottleStatement(int numBottles) {
if (numBottles == 99) {
print("99 bottles of beer on the wall, 99 bottles of beer.");