DEV Community

Discussion on: Project Euler #1 - Multiples of 3 and 5

Collapse
 
pbouillon profile image
Pierre Bouillon

I did this in LOLCODE (first program that I'm writing with it, probably not the best implementation)

HAI 1.2
    CAN HAS STDIO?
    I HAS A GOAL ITZ 1000
    I HAS A TOTAL ITZ 0

    I HAS A VAR ITZ 0
    IM IN YR LOOP UPPIN YR VAR TIL BOTH SAEM VAR AN GOAL
        BOTH SAEM 0 AN MOD OF VAR AN 3
        O RLY?
            YA RLY
                TOTAL R SUM OF TOTAL AN VAR
            NO WAI
                BOTH SAEM 0 AN MOD OF VAR AN 5
                    O RLY?
                        YA RLY
                            TOTAL R SUM OF TOTAL AN VAR
                        OIC
        OIC 
    IM OUTTA YR LOOP

    VISIBLE TOTAL

KTHXBYE
Collapse
 
philnash profile image
Phil Nash

👏👏👏👏👏

Collapse
 
pbouillon profile image
Pierre Bouillon

You can try it here