Could you use a free cup of coffee, Sup Forums?

Could you use a free cup of coffee, Sup Forums?

Other urls found in this thread:

jsbin.com/yezesojara/edit?js,console
pastebin.com/HbtmSexg
twitter.com/SFWRedditImages

fucking numales

>js
at least they are encouraging people to think

Even a non-coder can read that. bait/10

>not requiring the guest to attain sum of all prime numbers up to 3 billion, followed by bubblesorting all the digits in the resulting number in ascending order, and obtaining the amount of each digit followed by fizzbuzzing these 10 results

i dont even fucking know what language that is and i could read what secred word is without problems

you got bananas too, r-right?

Not 'require' that's stupid, you want as many customers as possible.
But it's not a bad challenge, if they can solve they get a free coffee for the day.
New challenge every weekday, make it a general brain teaser on the weekends (something anyone with high reasoning, but not necessarily skilled could get)

Suddenly you've got the cool new coffee shop in SF.

no, i got ILIKECOCKS obviously

they are not even trying what the fuck

No they couldn't. And they're called programmers, not “““coders”””

wew lad

Because you're a programmer

It's enough that a non-programmer wouldn't get it

>It's enough that a non-programmer wouldn't get it
>No they couldn't. And they're called programmers, not “““coders”””

Liberal arts students need to go back to

Green tea master race reporting in coffee is for wagies

Same here. White tea is even more potent but way pricier, at least the actual pure white tea leaves so I stick most of the time with green tea.

>Liberal arts students
./random-ad-hominem.sh > post

How long did it take you to entirely walk through this code anons? It took me a good 3 minutes or so. (never worked in JS)

Am I dumb?

kys

Where is this from?

You should re-seed your PRNG. The devastating retorts are getting a little stale.

The fuck are you on? I don't even know what language is that and I get it.

yeah that's because coffee actually does the job unlike tea

it seems like nobody in this thread have actually manage to find the word. since nobody is posting it. nether did you

>delcare your_drink (what convention does this retarded naming scheme follow?)
>do absolutely fucking nothing with it, don't even give it a value upon delcaring it, so all you have is a null object.
>pass drink in as argument
>argument throws exception
>coffee shop burns down.

God damn it.

I don't even code JS and it took me 20 seconds
>encryption

>Am I dumb?
Yes

No idea, found it on normiebook

Very funny one, wagie. As a NEET I have no need for stimulating drugs therefore the relaxing effect of tea is much more pleasurable.

It only took me a minute or two because I went really blind to the 'reverse' call on the second string.

>someone studied CS to end up as a barista

fuck

My secretary has a CS degree. They're basically worth nothing anyway.

This. I ended up dropping out of my CS degree once I was offered a position at a f500 by my professor. Nepotism/Connections > Pieces of paper

This really sucks. I'm bad at human interaction. I wish there were some online tutorials for that.

but you don't have a secretary

There are literally tens of thousands

It takes determined practice to get good at, just like anything

Hmmm well at least it's functioning code. Most of it.
Unlike stuff such as
If (know_c && need_job){
call.us@(*some phone number*)
}

These are the most obnoxious job ads, I hate them. Free coffee is nice tho.

No, I have two. One with 12 and one with 16 hours a week.

Nibba that's literally what I said. People who know programming in general but don't know JS can still read it. But people who don't program at all won't have a clue.

Kind of easy. Took me like, 4 seconds tops, and I'm barely a beginner programmer if that. Shit.

encryption

Why is 'call' a class? It can just be a function.

it's "secret word: encryption"
since when did javascript have fucking oop? and is that how you define a function inside an object?

You literally don't even need to have any experience with programming to get this. Someone who hasn't touched a lick of code in their lives would easily understand this but I guess muh publicity

Is that really how you reverse a string in javascript?

>never programmed anything in my life
>never read any programming book
>don't even know what programming language that is
>the secret word is clearly "encryption"

am I a natural born coding expert, Sup Forums?

There obviously are more efficient ways, but this one is probably the shortest.

"undefinedSecret word:encryption"

I think you overestimate how smart people are... I guarantee 90% of the US, probably 96+% couldn't get this.

jsbin.com/yezesojara/edit?js,console

Since release. The code in OP likely won't work, it's just an object without a class with a lambda function as one of values.

Heh, I don't even know English or what a computer is and I figured it out.

Heh, guess you really can't separate the cream from the coffee, heh... Sayonaro Sup Forums. Until we meet again.

This. I have zero experience with programming and this is stupid easy if you aren't completely braindead.

>fucking javascript
>just doing some fucking string manipulation

I would throw that free coffee in the face of that barrista

No, but you could propably succesfully copy/paste from stackoverflow

I think any technical-minded person could figure it out if they looked at it for a minute. Ive never written a line of code in my life and i was able to figure out what the word is.

I learned that you can join strings based on a specific criteria. I just added them to each other

var x = {
...
request : function(arg) {
return ...
}
};


what the fuck is this abomination

Whole careers are based on copy paste so give it a shot user.

No, you can define functions, but that's shitty practice because Javascript will just automatically execute it.

Putting functions inside variables (called anonymous functions) are more modular and clean.

You could even hide it inside object maps
var foo = {
bar: {
the_foobar: function() {
return "foo bar";
}
}
}

and execute it as

foo.bar.the_foobar();

you use request because it's only polite to ask your program nicely

request is sub field of the x object.

You could also write

request = function(){...}

Javascript has a lot of different ways of writing the same thing.

Do you even functional program

Won't the string a be infinite loop since the preference function is called upon in itself? I have zero knowledge on JS though, someone pls explain

I dont program and Ive got no clue what this means brainlet

I've done Lisp in uni without really understanding the underlying concepts and I do list comprehensions and generators in python but overall, no.

>apparently has no reading comprehension whatsoever
>calls other brainlets
lol?

I am too edgy for coffee.

just read through it an now i understand. Turns out youre right.

You mean the reverse thing? From what I can guess it takes the string, turns it into an array, reverses it and turns it back into a string because strings have no reverse method or something like that.

beautiful hand writing but man does the code look bad

'preference' is just a variable without value.

He declares the variable 'your_drink' at the top of the code, but doesn't actually initialize it.

Then he gives that undefined variable as a parameter to the function request() as a parameter.
The function request() then just prints that parameter as a string together with the other three fields.

Javascript doesn't give a fuck and just prints "undefined" if it is supposed to print the value of an undefined object.

Yeah, but that one's way too easy.

function reverseString(str) {
var newString = "";
for (var i = str.length - 1; i >= 0; i--) {
newString += str[i];
}
return newString;
}
reverseString('hello');

This would've been much nicer and just as easy to solve, but doersn't give JS a bad name with dogshit code.

>olleh

>writing your own algorithm instead of using the standard build-in functions
>nicer

Yeah no. Your solution is most likely way slower, especially considering you are creating new strings every iteration instead of manipulating an array.

Writing it yourself would have made for a better challenge for the reader though, that is true.

fpbp

?? this is one of the things there are more resources for than any other topic.

Go read "how to win friends and influence people" then find some kind of social event that interests you and try to apply those concepts. School is probably by far the best, if you're already working then try it on your co-workers. But relax and dont be a fucking sperg.

Not my solution, I just Googled "reverse string javascript" because it looked like the guy had copy-pasted it, which he had.

>But relax and dont be a fucking sperg.

This is so much easier said than done.

this desu

>le coffee!! XD
I fucking hate tech "culture"

Also it's actually slower to split it into an array, use the reverse function and then recombine it rather than treating it as an array directly as I suspected.

Seriously? Okay, I'm not a programmer, I can't even make it through an online course for python without feeling like I'm dying of boredom and even I could use basic logic to determine the secret word is "encryption" by reversing string 2, and putting it in the order of 2,3,1 like it says.

Even a fucking brainlet could reason that out in less time than it would take to eavesdrop and find out the secret word.

Captcha related: Prix Royal. Because they're Royal pricks (yes I'm aware that's not how you pronounce prix)

'encryption' seems obvious enough but what the FUCK is wrong with javascript

No wonder people use Python to teach programming

I hope you do realize tea contains caffeine as well as evidenced by the fact that it makes you piss like a racehorse

I make my own fucking coffee

You underestimate people's stupidity. Most people see code or code-like stuff and their brain shuts off completely.

Non programmer here, didn't see any replies. The secret word is encryption.

Am I gifted?

Yes, you should install gentoo and learn assembly ASAP

nah, most of us cbf posting something so obvious

>doesnt give JS a bad name

Coffee is anti-androgenic and basically a free ticket to lowtest soyboyland. It's a shit colored, african-arab beverage that's killing western civilization.

your_drink = ""
reverse = lambda s: ''.join(list(s)[::-1])

class Barista:
str1 = "ion"
str2 = reverse("rcne")
str3 = "ypt"
def request(this, preference):
return preference + "Secret word:" + this.str2 + this.str3 + this.str1

barista = Barista()
barista.request(your_drink)

When I tested it your solution was consistently slower. Not that it is a useful test with such a short string and only one execution.

pastebin.com/HbtmSexg

>go inside
>say the word and get a coffee
>ask for who wrote the code
>throw steaming hot coffee at his/her/xir/oy/vey face and scream "segmentation fault"

Your solution allocates a new string for each character, and then allocates another string each time you add a character to the final result. As string size increases, your solution will approach half the speed of the built-in solution at best

Haven't touched any kind of programming in over a year(NEETlife) , but it was easy peasy as fuck. I don't like this language though

>preference+"Secret word:"+this.str2+this.str3+this.str1
"coffeeSecret word:encryption"?

no more like "undefinedSecret word:encryption"

>str2+3+1
>huh it says what str are right here
>rnce in reverse ypt and ion
>wow that sure was difficult

i can't even program and it was stupid easy, do they just want to give literally everyone free coffee and bankrupt themselves?