Talk:99 bottles of beer

From Rosetta Code
Revision as of 17:12, 18 May 2010 by rosettacode>EdK (The page is getting big)

CPP Recursive

Hope you dont mind but i put in a 99 beer solution i had to do for a class a while back. I have my origional reference here: http://csinsider.homeip.net/index.php/CPP_Pro#Program_.234_Recursion_on_99_bottles_of_beer I figure that you guys helped me so much, i can at least contribute a bit.

CPP

What about taking the two "with preprocessor" examples from C and C++ -- is there any difference between them? -- and making them an example of the language CPP, the C preprocessor? Don't C and C++ share the same preprocessor? Note that CPP can be run all by itself, as well.

Syntax highlighting

What's the story with syntax highlighting? I kind of like it, but are we going to use it on tasks from now on? --Mwn3d 12:23, 28 February 2008 (MST)

I'm ambivalent until we have more/better language support. However, if other folks don't find having some languages supported while others aren't, then I wouldn't mind seeing its use expanded. NevilleDNZ was going to work on on a means of importing Vim syntax highlighting scripts so that the syntax highlighter could be extended. I'd be curious how that's coming. --Short Circuit 21:02, 28 February 2008 (MST)

Common Lisp

The Common Lisp solution is ... not very good!

  • there's some wiki quoting/escaping/formatting issue with "defun"
  • it uses (- x 1), where (1- x) is shorter and probably more idiomatic
  • it uses (> .. 0) instead of zerop
  • it uses a 1-form if instead of when
  • it's recursive when it really doesn't need to be
  • it uses massive indentation
  • it says "1 bottles of beer", when it's trivial to say "1 bottle of beer"
  • it uses ~a (any text) instead of ~d (integer) for printing integers
  • it doesn't leave a line between verses
 (defun bottle (n)
   (format t "~D bottle~:P of beer on the wall~%" n)
   (format t "~D bottle~:P of beer~%" n)
   (format t "Take one down, pass it around,~%")
   (format t "~D bottle~:P of beer on the wall~%~%" (1- n) (1- n)))
 (defun bottles (x)
   (loop for i from x downto 1 do (bottle i)))
 (bottles 99)
Be bold! It's a wiki, feel free to fix any problems yourself. (Many of the examples were contributed by undergraduates who were just learning the languages themselves.) --IanOsgood 18:33, 9 December 2008 (UTC)
The formatting issue is known also. We use an open source syntax highlighter that isn't always perfect. We can't figure out how to fix it ourselves and there have been more important issues since we saw those problems. --Mwn3d 18:52, 9 December 2008 (UTC)

Page Size

This page is getting VERY big. It probably should be broken int three or more smaller pages. I'm not sure what the best way to do that would be.

One possibility that comes to mind is to partition the languages alphabetically: A-C: D-J; K-P: and Q-Z.