Slashdot Mirror


Quadrilingual Crazy Programming

mtve writes: "Have you ever seen source code that is valid on four languages: Perl, C, Befunge, and BrainF*ck? During last Perlgolf season famous Perl hacker Jérôme Quelin submit such inconceivable masterpiece and now he published expanded explanation of his solution. Caution: that text can hurt your mental health. Play Perlgolf!"

17 of 194 comments (clear)

  1. Not for me... by PepsiProgrammer · · Score: 5, Funny

    I have enough trouble making my code compile in ONE language, 4 at the same time is a bit much

    --
    "The United States has no right, no desire, and no intention to impose our form of government on anyone else." - Bush 05
    1. Re:Not for me... by larry+bagina · · Score: 4, Funny
      I have enough trouble making my code compile in ONE language, 4 at the same time is a bit much

      Hi Linus. I didn't know you posted to Slashdot!

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

  2. omg... by Danse · · Score: 5, Funny

    He should seek professional help. Soon. That's right up there with self-mutilation.

    --
    It's not enough to bash in heads, you've got to bash in minds. - Captain Hammer
    1. Re:omg... by SkulkCU · · Score: 4, Funny


      He should seek professional help. Soon.

      at the bottom of the page:

      the referees were so impressed by my efforts (one of them told me that I deserve a book. And a straightjacket. And a padded room [...] they decided to grant me a book for my efforts.

      --
      .sig last updated Jan. 14, 2000
  3. Wow, but slight dilemma by lkaos · · Score: 4, Funny

    Now this is exactly why I am proud to be a programmer. Screw Picaso and DaVinci, this is what real art is all about.

    This presents an interesting dilemma though. What Emacs mode do I use to look at the code??? perl-mode, c-mode, I dunno. Fontifying just complicates it even more.

    At any rate, this shit is going up in my cube. If they should this in a frame, I would buy it and hang it in my house.

    --
    int func(int a);
    func((b += 3, b));
  4. Portable by Myshkin · · Score: 2, Funny

    Well, I guess that is one way to keep people from saying that your implementation isn't portable enough.

  5. simpler version by damiam · · Score: 4, Funny
    This program is valid in C, C++, python, perl, basic, and a few other languages, and it also accomplishes the rare feat of printing its own source code without reading from a file:





    Note that, even though this is standard C, gcc won't compile it, complaining about the lack of a "main" function.

    --
    It's hard to be religious when certain people are never incinerated by bolts of lightning.
  6. Too Bad... by susano_otter · · Score: 5, Funny
    Have you ever seen source code that is valid on four languages: Perl, C, Befunge, and BrainF*ck? During last Perlgolf season famous Perl hacker Jérôme Quelin submit such inconceivable masterpiece and now he published expanded explanation of his solution. Caution: that text can hurt your mental health.

    Ironically, the article isn't even valid in one language.

    --

    Any sufficiently well-organized community is indistinguishable from Government.

  7. Befunge? by Quixote · · Score: 4, Funny
    From the article (yes, I read it, and yes, my jaw won't close now):
    Befunge is, ... a topological language on a 2D cartesian Lahey space.

    Holy mackerel! I am in love. I've found the object of my dreams.

  8. Re:not quite as cool as it sounds. by csguy314 · · Score: 2, Funny

    In this file, if I change the problem-solving logic slightly, I have to change it in several places. What would be truly cool (and incredibly difficult), in my opinion, would be to completely eliminate redundant logic.

    What?!? Eliminate redundant logic? That would put microsoft out of business!
    MacOS ~ Windows
    Java ~ C#
    Diablo ~ Dungeon Siege

    --
    This is left as an exercise for the reader.
  9. I'm glad I'm already a programmer... by yorgasor · · Score: 4, Funny

    Wow, if I saw that a few years ago, I would've been so scared I would've never touched another programming language again! Slashdot, please think of the children before you post things like that.

    --
    Looking for a computer support specialist for your small business? Check out
  10. Re:i know it's silly... by skribble · · Score: 2, Funny

    Huh?

    Of your list only C++ is a language. However one could right an Apache module in C++ that accesses a MySQL database... err wait actually that been done!

    --
    --- Nothing To See Here ---
  11. Re:i know it's silly... by lkaos · · Score: 3, Funny

    Don't mind him, he's just a troll...

    Gees, maybe I need to stop reading /. ... I'm starting to recognize the trolls by username.

    --
    int func(int a);
    func((b += 3, b));
  12. 4 Languages? Whoopty doo. by Clay+Mitchell · · Score: 3, Funny

    Try to get a website to look the same in every web browser.

    That's an impressive feat?

    Netscape 4.X = Worst browser ever!

    1. Re:4 Languages? Whoopty doo. by Arandir · · Score: 3, Funny

      "We detect that you're using the Konqzilla browser. Since by using Konqzilla our site may appear 'fugly', we have no other alternative but to deny you entrance."

      "Your browser identifies itself as Internet Explorer 5.5 running on Windows XP. But it's really Konqzilla. I don't know why you want to see our site using Konqzilla. Please use a modern browser to view this site. Now go away."

      "It appears that you're running Internet Explorer 5.5 running on Windows XP. And it's the real thing this time. But you're running it under WineX. Do you think we're stupid. We don't want you to view our site. Now bugger off!"

      "Ah, a genuine Internet Explorer 5.5 running on a genuine Windows XP! Congratulations. But you have your monitor temperature set to 5000! Our site was designed for 9300. It will look fugly without it. Please correct the situation before returning"

      --
      A Government Is a Body of People, Usually Notably Ungoverned
  13. Cease and Desist Warning. by DarkHelmet · · Score: 3, Funny
    http://slashdot.org/comments.pl?sid=32469&cid=3504 205

    Poster named Damiam, you are in violation of the terms of my license. You are hereby asked to cease and desist from distributing your code, and will be contacted shortly with a cease and desist letter saying the same message.

    If you do not pay royalties to me, I shall strip you of all your Karma, and fart in your general direction. :)

    By the way, if you claim prior art, this is not true. I came up with this program back in 1984 when I was banging enter on the keyboard of my Commodore Pet computer and realized that I was programming it without my knowledge.

    --
    /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
  14. BrainFuck Nanobots? by DarkHelmet · · Score: 3, Funny
    Can you seriously imagine on the Nightly News them doing a story about how BrainFuck programmed NanoBots kill AIDS cells, and kill off tumors?

    News Reporter: So how'd you do it?
    Guy: Well, the nanotech was already there. I just wrote a small program in BrainFuck in order to hunt down the virus.

    Well, at least censorship would go out the window the same time we cure World Disease.

    --
    /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i