Nah just kidding but heres a shitty programming quiz for all you software engineers

Prize: ???

CV: $30.01

End: 7/5/2013 12:01AM (4 hours left from last edit)

http://itstoohard.com/puzzle/Lx76mz14

v1.0 - Original

v1.01 - Added More Choices

v1.02 Final - Fixed Syntax Issues

Usual rules apply, don't give out answers or hints.

1 decade ago*

Comment has been collapsed.

I'm still learning it :(

1 decade ago
Permalink

Comment has been collapsed.

That awkward moment when PHP isn't considered programming.

Although I don't know PHP that much, I can understand what it does, but I have no idea what you want from us.

1 decade ago
Permalink

Comment has been collapsed.

me neither

1 decade ago
Permalink

Comment has been collapsed.

Me 2. Have some knowledge of PHP but I don't have the slightest idea what he wants.

1 decade ago
Permalink

Comment has been collapsed.

I really hoped for some Hard C or assembly problem...

1 decade ago
Permalink

Comment has been collapsed.

What if my input is ";drop table giveaways;"?
Oh ninja'd :/

1 decade ago
Permalink

Comment has been collapsed.

Do something using Matlab or C, please. :(

1 decade ago
Permalink

Comment has been collapsed.

Deutsche Bank? o.o

1 decade ago
Permalink

Comment has been collapsed.

I'm probably missing something here since my brain isn't wired for PHP these days, but isn't it impossible to tell what you're echoing if we know nothing about the database you're getting your data from?

1 decade ago
Permalink

Comment has been collapsed.

Is this a programming quiz or a brute-force quiz?

1 decade ago
Permalink

Comment has been collapsed.

10 IF X = 42 GOTO 40
20 X = X + 1
30 GOTO 10
40 PRINT "X is finally 42!"

syntax error
:D

1 decade ago
Permalink

Comment has been collapsed.

/r/shittyprograming here. It will eventually reach 42 even if it has to integer overflow.

1 decade ago
Permalink

Comment has been collapsed.

Using GOTO for a simple loop.

That's terrible.

1 decade ago
Permalink

Comment has been collapsed.

Indeed. He should have recalibrated his function to forward the conductive resonation in sync with class inheritance. That would have catalysted the intrical parameters required to DDOS the prime value of the subatomic matrix. Simple looping any child could do.

1 decade ago
Permalink

Comment has been collapsed.

You never defined X

1 decade ago
Permalink

Comment has been collapsed.

Assuming this is something like QBasic, he doesn't need to.

1 decade ago
Permalink

Comment has been collapsed.

i have this problem in mcpixel and they ask me to solve it :O im not so\that smart

1 decade ago
Permalink

Comment has been collapsed.

require 'dbconnect.php';
/r/ dbconnect.php source

1 decade ago
Permalink

Comment has been collapsed.

Too much bruteforce for me..

1 decade ago
Permalink

Comment has been collapsed.

10 Print "HURT"
20 GOTO 10

1 decade ago
Permalink

Comment has been collapsed.

DO
PRINT "HURT"
LOOP

ftfy

1 decade ago
Permalink

Comment has been collapsed.

Professional programmer with nearly a decade of experience in PHP here.

The code is using a deprecated module (mysql) and is very prone to SQL injection; it should be using prepared statements via either the mysqli or PDO modules.

The code is looking for a GET HTTP request where the input parameter is equal to the answer. So we'd need to set $_GET['input'] to the answer, of which could be any string whatsoever - there is no hint in the code as to what the answer is.

Alternatively, we could set $_GET['input'] to a certain string to SQL inject the database and dump the entire giveaway table.

The puzzle mentions using $a as a dummy string, but this is in no way applicable to any of the code, unless it confusingly is asking you to set $_GET['input'] to 'a' in order to get the answer, in which case it still makes very little sense and is worded quite poorly.

tl;dr This puzzle uses poor quality code and makes no sense.

1 decade ago
Permalink

Comment has been collapsed.

"Shitty Programming Puzzle"

1 decade ago
Permalink

Comment has been collapsed.

A programmer should have standards even when being shitty.

1 decade ago
Permalink

Comment has been collapsed.

It actually was the same for me - code made no sense at all, but when I see discussions in this thread I clearly understand that I've missed somthing in this life and I've no puzzle thinking :)

1 decade ago
Permalink

Comment has been collapsed.

You don't seem to get the solution to this puzzle. I do, but there are still several possibilities to make the if-clause true and everyone of those can be written differently (depending on personal coding preferences). It's like free text, and free text is never a good response to a question that is based on simple string comparison (like itstoohard-puzzles)

1 decade ago
Permalink

Comment has been collapsed.

Try the new version, it should contain other acceptable formats.

1 decade ago
Permalink

Comment has been collapsed.

I tried a few working possibilities, but without knowing which exact approach the creator had in mind (and how he usually formats his code) i won't try again. Too much brute force

1 decade ago
Permalink

Comment has been collapsed.

You don't seem to get the solution to this puzzle. I do

Judging from the number of people who've solved it, you're the only one.

1 decade ago
Permalink

Comment has been collapsed.

its been less than an hour and this is an oddly specific question, i think 1 is pretty good

1 decade ago
Permalink

Comment has been collapsed.

Less experience here but I tend to agree.

1 decade ago
Permalink

Comment has been collapsed.

emm. 2x2 is 4

1 decade ago
Permalink

Comment has been collapsed.

Nice idea but It's hard to get the same syntax that you want. There are several ways to get the same result... it'd be better to use a real server running this php so we can get the link by ourself instead of trying to guess what syntax was the one that you wrote down as correct answer.

1 decade ago
Permalink

Comment has been collapsed.

The answer format is just the string right?

1 decade ago
Permalink

Comment has been collapsed.

yup, imagine that text box is connected with the variable $_GET['input']

1 decade ago
Permalink

Comment has been collapsed.

Hmmm ok , time to think :3

Worked with PHP a little , Mostly with MySQL , hope I'll find the answer :D

1 decade ago
Permalink

Comment has been collapsed.

Please don't use PHP. It's the worst "programming" "language" ever "designed". Stay away from it, because it's broken, undesigned (I know that's not a valid word) and you won't learn anything that would apply to actual programming.

1 decade ago
Permalink

Comment has been collapsed.

As a professional web application developer with nearly 10 years of experience in PHP, I tend to agree with you. The language is incredibly terribly designed, but it is very viable for both small and massive applications alike. If you want to learn programming, don't learn PHP. If you must learn PHP, first learn another programming language, so you have some idea of why PHP is so terrible.

I've participated in PHP's language design mailing lists, i.e. the people who work on new features and what-not, and the language isn't going to get better. It's just a clusterfuck of bad design.

Personally, I recommend node.js. It's new and not as popular as other choices, but it's an incredible piece of software that has a lot of promise.

If you just want to learn programming, start with C. Not C++, not C#, C.

1 decade ago
Permalink

Comment has been collapsed.

Even VB6 is "very viable". That doesn't make it any good and doesn't mean you should use it ;) PHP is a serious clusterf*ck made by people with no theoretical knowledge nor prior development experience. It truly is unfixable at this point.

I don't think C is a good starting point, simply because it has pointers, and unless you're going to do low-level development, you don't need them. JavaScript is neat, but the whole prototyping thing won't apply to other languages later. Some people swear by Python as a starting point, but I will recommend C# - simply because it's the most advanced language right now, and along with Java, an industry standard.

1 decade ago
Permalink

Comment has been collapsed.

VB6 is not viable in the sense that PHP is. With PHP, you can easily create a simple or complex website, whether you're a single 14 year old or a professional company of thousands. The application can be designed so that it's easily maintainable. With proper caching and database design, speed is not an issue. PHP is a perfectly fine choice for any level of web developer, aside from the fact that the language itself is terribly designed.

C is a great starting point if you want to learn programming. By learning the basics early on, you'll have a much easier time with higher-level programming languages, and you'll have a better understanding of programming in general.

JavaScript is a great programming language, and the more you use it, the more you'll love it. Coming from a background in primarily classical object oriented languages, numerous parts of JavaScript were hard for me to grasp initially. The more I use it, the more I love it. It's incredibly flexible.

Python and C# are great languages all-together, though they're high-level and thus they wouldn't be my first recommendation to someone with no prior programming experience. Java is fine for the most part, but I often see Java developers tending to over-use object-oriented design in their applications, Java and not, and that's never a good thing. This is something I see more in Java developers than developers on any other programming language, so I assume it has something to do with the design of either the language or popular libraries/apps.

Rather than unlearning bad practices, learn the good ones first.

1 decade ago
Permalink

Comment has been collapsed.

There's still tens of millions of people running business-critical VB6 code.

Also, the words "PHP" and "maintainable" really don't belong anywhere near each other :)

1 decade ago
Permalink

Comment has been collapsed.

You just try finding a client who would ask of you writing, or maintaining, his website using perl, python or ruby. I have yet to meet one. And absolutely no-one I've worked with ever had mod_perl, mod_python or Rails installed on the server, so you also can try persuading them into changing that.

All in all, the sad truth is that if you are a contractor, you simply need to know and work with that godawful language well enough to circumvent at least some of its godawfulness. I wouldn't even call PHP a language, it's more of a toolbox -- I guess when you don't call it a language in the first place, you can somewhat mitigate its messing with your brain.

1 decade ago
Permalink

Comment has been collapsed.

RoR was quite popular several years ago; I have no idea what happened to it since. Wouldn't surprise me if most of the stuff had been rewritten in something else.

I spent three years doing PHP, then had a short Joomla-PHP gig a couple of years ago. If I had to do it again, I'd probably jump off a bridge. Some things just aren't worth the money...

1 decade ago
Permalink

Comment has been collapsed.

I hear ya.

1 decade ago
Permalink

Comment has been collapsed.

1 decade ago
Permalink

Comment has been collapsed.

If you have any source for the VB6 statistics, I'd be interested in seeing them. I'm talking about enterprise web applications here. I have not heard nor, after brief research, do I see any numbers on modern-day VB6 popularity in regards to web applications or otherwise. I do find that quite intriguing, and would love to see some relevant data here.

Using quality, proper object oriented design, PHP applications can be around as easily maintainable as any application designed with any other object oriented programming language.

1 decade ago
Permalink

Comment has been collapsed.

It has some flaws but it's very useful and fast if you know how to use it.

What language would you use instead? ruby? python?
We are talking about interpreted languages or scripting, don't mention anything involving compilation.

1 decade ago
Permalink

Comment has been collapsed.

You can compile python scripts to pyc files.

1 decade ago
Permalink

Comment has been collapsed.

I wouldn't call that process "compiling" :D

1 decade ago
Permalink

Comment has been collapsed.

[EDIT] Derp, never mind. I need to learn to read.

1 decade ago
Permalink

Comment has been collapsed.

I was expecting to find some complex code in Assembler, or a nice riddle in C++.

D:

1 decade ago
Permalink

Comment has been collapsed.

I was expecting something C++.

1 decade ago
Permalink

Comment has been collapsed.

damn PDO, I forgot these things xD

1 decade ago
Permalink

Comment has been collapsed.

always use PDO's or bad things will happen!

1 decade ago
Permalink

Comment has been collapsed.

I know a little tiny bit of C#, but dafuq is this?

1 decade ago
Permalink

Comment has been collapsed.

Bump

Code/Answer combination was wrong! I contacted OP and the code is now fixed! Try it again ;)

1 decade ago
Permalink

Comment has been collapsed.

i still have no idea how 5 people managed to get the same wrong answer as me

1 decade ago
Permalink

Comment has been collapsed.

Google my friend... It's all about Google xD

1 decade ago
Permalink

Comment has been collapsed.

Basic deduction was the key.

1 decade ago
Permalink

Comment has been collapsed.

It said "Basic Deduction" is wrong. Or did you win the give away? Why are you giving out the key? I think somebody ninja'd it.

1 decade ago
Permalink

Comment has been collapsed.

I'm still learning PHP, so I can't help.

1 decade ago
Permalink

Comment has been collapsed.

Well, props to the people that found out what we're looking for.

1 decade ago
Permalink

Comment has been collapsed.

FORTRAN, floating point, BASIC, PASCAL, ... I don't think you guys even consider these programming languages, anymore. I've got nothing for this giveaway.

1 decade ago
Permalink

Comment has been collapsed.

Kind of understanding the code, but not sure what you want as the answer.

1 decade ago
Permalink

Comment has been collapsed.

Closed 1 decade ago by gangnamstyle.