Page 1 of 1

LOLCODE!

Posted: 2007-10-27 11:49pm
by Spyder
Hai!

I has a link!

Code: Select all

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

Code: Select all

HAI
CAN HAS STDIO?
I HAS A VAR
GIMMEH VAR
VISIBLE "You said " N VAR N " !!"
KTHXBYE
This guy's prime factoring program

Code: Select all

BTW LolCode Implementation of a program I had to write for my Java class, a long time ago.
BTW LolCode Spec 1.2, with GOIN UP/DOWN as laid out here: http://forum.lolcode.com/viewtopic.php?pid=2406#p2406
BTW There might be some syntax/usage/logic errors around, but that's to be expected in a language that's still forming and doesn't have a standard compiler.
HAI
    BTW Define some useful functions
    HOW DUZ I SGN YR SPEECHINGS
        GOIN DOWN 0 AN SPEECHINGS MKAY
        O RLY?
            YA RLY
                FOUND YR -1
            NO WAI
                FOUND YR 1
        OIC
    IF U SAY SO
    HOW DUZ I ABS YR SPEECHINGS
        FOUND YR PRODUKT OF SPEECHINGS AN SGN SPEECHINGS
    IF U SAY SO
    
    I HAS A WHATUSAY
    I HAS A factor1 ITZ 1
    I HAS A factor2 ITZ 0
    I HAS A numOfFactors ITZ 0
    VISIBLE "Input a number to be factored."
    GIMME WHATUSAY
    WHATUSAY IS NOW A NUMBR
    VISIBLE "Factors of " AN WHATUSAY AN ":"
    IM IN YR loop
        GOIN UP ABS WHATUSAY AN PRODUKT OF factor1 AN factor1 MKAY
        O RLY?
            YA RLY
                GTFO
        OIC
        
        BOTH SAEM 0 AN MOD OF WHATUSAY AN factor1
        O RLY?
            YA RLY
                factor2 R QUOSHUNT OF WHATUSAY AN factor1
                numOfFactors R SUM OF numOfFactors AN 1
                VISIBLE "[" AN factor1 AN "," AN factor2 AN "]"
                VISIBLE "[" AN PRODUKT OF factor1 AN -1 AN "," AN PRODUKT OF factor2 AN -1 AN "]"
        OIC
        factor1 R SUM OF factor1 AN 1
    IM OUTTA YR loop
    BOTH SAEM 1 AN numOfFactors
    O RLY?
        YA RLY
            VISIBLE "Note: This number is a prime number."
    OIC
KTHXBYE
:D

Posted: 2007-10-28 12:57am
by Tasoth
that makes my head hurt and my urge to kill the developer is rising.

Posted: 2007-10-28 01:14am
by Resinence
Tasoth wrote:that makes my head hurt and my urge to kill the developer is rising.
Actually it's surprisingly easy to read, and the syntax is pretty standard. As well as being very much like plain (bad) english. It's not as bad as I would have expected.

Posted: 2007-10-28 01:14am
by Zablorg
Tasoth wrote:that makes my head hurt and my urge to kill the developer is rising.
Oh come on now, this is just classic! I want everything to be coded this way!

Posted: 2007-10-28 01:37am
by Fingolfin_Noldor
I think my brain spontaneously combusted as well. :shock: :x

Posted: 2007-10-28 01:45am
by General Zod
I LOLed. :D

Posted: 2007-10-28 02:16am
by Enforcer Talen
Time for lolcatbible.

Yes, its real.

Posted: 2007-10-28 02:48am
by Davis 51
Dude, I want a compiler for this so bad.

Posted: 2007-10-28 03:32am
by Zablorg
Do they have the command "Caturday"?

Posted: 2007-10-28 10:16am
by Dooey Jo
That's horrible and a sign of a future where everyone has forgotten the languages of old and speaks only in internet memes. It is a dark future; a cyberpunk future; a retarded, drooling future.

Does "FAIL" throw an exception in that language?

Code: Select all

IT IS DANGEROUS
  FAIL "snarp"
OH SNAP
  WHAT HAPPEN?
PWNT

Posted: 2007-10-28 03:00pm
by RThurmont
There really does need to be an interpreter for that...I'm disturbed by the fact that I'm pretty much understanding what it says.

Posted: 2007-10-28 04:24pm
by Einhander Sn0m4n
Davis 51 wrote:Dude, I want a compiler for this so bad.
Seconded. Even I, the non-coding script-kiddie, can understand and learn to code with this.
RThurmont wrote:There really does need to be an interpreter for that...I'm disturbed by the fact that I'm pretty much understanding what it says.
HA! if an MBA can understand this, I most certainly can!

Posted: 2007-10-28 06:00pm
by phongn

Posted: 2007-10-28 06:04pm
by Starglider
Oh joy, it's INTERCAL for 4chan tards. But without any of the subtlety or skill.

Posted: 2007-10-28 08:41pm
by RThurmont
[quoteHA! if an MBA can understand this, I most certainly can![/quote]

I'm not an MBA, and I've been getting heavily into programming in my spare time, as a hobby, in the past year (working towards learning Ruby and C primarily at this point). I'm understanding it because portions of it are obviously analogous to Ruby or C code, for example, VISIBLE appears to mean "printf" or "puts" and "KTHXBYE" "end."

Posted: 2007-10-29 04:23am
by ThatGuyFromThatPlace
I would love to have seen the effort that went into this go into a natural-language programming language.
As it is, this stuff makes my brain hurt something fierce, but it has some elegance to it as well, I wouldn't mind programming in it, but I'd have to be drunk off my ass to actually write anything that retarded.

Posted: 2007-10-29 11:00am
by Raptor 597
On phongn's posted implementations page the lolpython thing is pretty need, what with coding Fibonacci numbers and all.

Posted: 2007-10-29 11:36am
by phongn
ThatGuyFromThatPlace wrote:I would love to have seen the effort that went into this go into a natural-language programming language.
Like AppleScript or somesuch? A purely natural-language language would be unworkable as the grammar is too imprecise.