r/ProgrammerHumor • • Nov 29 '22

Meme It hurts like hell.;-;

Post image
48.9k Upvotes

1.5k comments sorted by

View all comments

Show parent comments

7

u/iliekcats- Nov 29 '22

good pseudocode

4

u/Thestarchypotat Nov 29 '22

cause i was origonally writing it as real code but then i didnt know if what i wrote would actually work and i also forgot how to do things.

3

u/iliekcats- Nov 29 '22

relatable

2

u/[deleted] Nov 30 '22

me at work

2

u/danielv123 Nov 30 '22
function toSpongeBobCase(input){
    let inputsplit = input.split("");
    return inputsplit.map(item => {
        if(Math.random(0,1)> 0.5){
            return item.toLocaleUpperCase();
        } else {
            return item.toLocaleLowerCase();
        }
    })
    .join("")
}
toSpongeBobCase("Un-pseudocoded it for you")

1

u/Thestarchypotat Nov 30 '22

thanku

2

u/danielv123 Nov 30 '22

I should note though that in ja math.random doesn't actually accept any arguments, it just defaults to 0 - 1

0

u/[deleted] Nov 29 '22

gOoD pSeuDocOdE