3 ms·
2 bottles of beer on the wall, 2 bottles of beer. Take one down and pass it around, __1 bottles__ of beer on the wall. Oops. This bug is more to do with not t
by bhrgunatha 16y ago
2 bottles of beer on the wall, 2 bottles of beer.
Take one down and pass it around, __1 bottles__ of beer on the wall.
Oops.
This bug is more to do with not taking enough care over the problem, rather than the language. I do like pattern matching for arguments - it's a great feature of Haskell, but I suspect writing tables makes it more trouble to express than some other notation.
- jws 16y agoProgrammers are, as a whole, fairly bad at making programs to print the lyrics of 99 Bottles of Beer on the Wall. You can peruse 1400 versions in nearly as many languages at http://www.99-bottles-of-beer.net/ http://www.99-bottles-of-beer.net/ A few minutes spent there raises questions about how people communicate. Even the C example, written in pthreads with 10 cooperating threads so it is likely by a programmer that pays attention to details, gets the "2 bottles" case wrong, it will pluralize the after takedown count. Most examples think of the pluralization issues, very few notice that the "one bottle" case has "take it down" instead of "take one down". Even the Haskell crowd that has versions with guards, versions with monads, and a version as a list comprehension missed this. (Mine is correct. does gloatey dance But it has, sadly, outlived its language. )