Skip to content
Tags

,

Funny C# Code

August 11, 2009

Even though I don’t know the author of the lines below I would say “Thank you man”. I recieved them today on skype by one of my ex-collegues.

        try

        {

        HOME:

            do

            {

                Play(“World of Warcraft”);

            }

            while (!asleep);

 

            Thread.Sleep(12 * 60 * 60 * 1000);

 

            WakeUp(coffee);

 

            if (you_still_give_a_shit())

                goto WORK;

            else

                goto OUT;

 

 

 

        WORK:

            do

            {

                if (got_something_to_do())

                {

                    LookAtTheMonitor();

                    Press_Some_Keys(new string[] { “Ctrl+C”, “Ctrl+V” });

                }

 

 

 

                Browse(“vbox7.com”);

                Browse(“topsport.bg”);

                Browse(“youtube.com”);

 

                Have_a_Break();

                Have_a_Kitkat();

 

            }

            while (DateTime.Now.Hour < 5);

 

 

 

            if (DateTime.Now.Day == 1)

            {

                // at least

                GetSomeCash(3000);

            }

 

 

 

        OUT:

            switch (mood)

            {

 

                case Mood.Horny:

                    ChaseChicks(“hot!”);

                    break;

                case Mood.Dull:

                    SmokeSomeStuff(new Stuff[] { “Grass”, “Serious Stuff” });

                    break;

                default:

                    DrinkBeer(5);

                    break;

 

            }

            goto HOME;

 

        }

        catch (HealthException x)

        {

            SeeTheDoctor(x);

        }

        catch (NoMoneyException)

        {

            ShitHappens();

        }

From → Bulletin

10 Comments
  1. This site rocks!

  2. Excellent site, keep up the good work

    • Svetlin Ralchev permalink

      Thanks, Bill. Good luck to you.

  3. Java permalink

    You should add:

    case Mood.Smart:
    learnJava();
    return Mood.Happy;

    :P

    • hahahaha :) so only java developers are smart?!

    • Heath-Hunter permalink

      return Mood.Happy;

      warning CS0162: Unreachable code detected :)

  4. Dude, you don’t need “break;” in the two first cases… and in fact you don’t need it after default case, as it is the last one :)

    • I haven’t written the code above, but why I don’t need ‘break’. I think that only in case of ‘return’ I don’t need it.

      • After chasing chicks you might feel a little dull (not necessarily, but possible) and it would be nice to continue checking the mood for any other cases. Will you go directly home, if you feel dull after chasing chicks? Or even if not, will you go home without having several beers?

        My suggestion is to remove “break;”, to go through all the cases, or move “DrinkBeer(5);” out of the switch construction, that way ensuring you won’t miss the important part of the evening ;)

        Cheers!

      • ahh sorry I was too tired when I read your words. Now I understood what you mean. Yeah, we can’t live without bere. By the way the code above has unknown author.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.