Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language c++

(ob fuscated)

Date:08/11/05
Author:Tapi (Paddy O'Brien)
URL:n/a
Comments:4
Info:http://www.sgi.com/tech/stl/
Score: (2.27 in 26 votes)
                                                     /* obfuscated 99
						     bottles   program 
						     in c++ coded  by 
						     paddy   obrien */
                                                   #include <iostream>
                                                  using namespace std;
                                                void beer(int,int);    void
					       wall(); int main() {        int
                                              bottles                        =99; 
					      while                      (bottles)
                                            {for(int i=0;    i < 2;          ++i) 
                                            beer(        bottles,i);  cout   <<
                                            "take one down pass it around"
                                           <<  endl;                        beer
                                            (--bottles,                            0)
                                            ;cout    <<                      endl;} 
                                            return      0                            ;}
                                            void beer      (int  bottles, int i)
                                            {cout <<                       bottles
					    <<            "  bottle(s) of beer "; 
                                            if(!i)            wall(); else cout << 
                                            endl;}  void wall(){              cout 
                                            << "on the wall"         <<endl;}
                                            /*Yeah I know it's          a sorry
                                            excuse for                    a bottle
                                            but given how little code    was
                                            required it's the               best I
                                            could/felt like doing,    oh  and
                                            by the way all the     comments
					     \are purely                  filler  */

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
object-oriented versionTim Robinson04/20/054
hacking styleTim Robinson04/20/0514
extreme template metaprogrammingRichard Wolf04/20/055
meta programmingArion Lei04/20/055
Preprocessor & self-include recursionChocapic02/27/076
feature creepJono04/27/091
most extreme template metaprogrammingHenrik Theiling12/04/110
8Jono04/15/090
GUI versionMartyn Davies05/28/051

Comments

>>  Pulseczar said on 07/29/06 08:38:27

Pulseczar the fug?

>>  dj alejo said on 07/27/09 10:57:05

dj alejo Indeed, it's no obfuscated. It's more like usual code with an unusual identation.

>>  Lurveleven said on 05/31/10 12:06:23

Lurveleven Far from giving the correct output.

>>  barrym said on 06/02/10 04:44:38

barrym I agree with Lurveleven.
I humbly suggest that the author fill up the 'bottle' of code with code
that actually outputs the specified song lyrics.
Then maybe the comments could be not only smaller, but more informative.

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: