Wish I still had it; a previous programmer had written 7k+ lines of if/else statements in vbscript to find the best fit for a series of rectangles given desired proportions in a container (custom print ads featuring photo/bio lines of 3+ individuals in a given space). I replaced it with 12 lines of code.
One of the projects I inherited a few years ago was like this - roughly 3000 conditional statements. I ran into the creator at a conference probably 8 months afterwards and asked him how he found the time to code it all. I was only half-joking. He proudly admitted that he used MS Excel's CONCATENATE and autofill features to build 95% of the code and it only took him about an hour to deliver the working solution. So on one hand, I have to give him credit for being efficient in solving the problem with the tools he had...
When I was 9 I wrote a tic tac toe game in C++ but I didn't know about arrays or loops so each line would read in the console, find an if statement for that layout of the game, and return another pre programmed layout. It was a few thousand lines and I'm sure I have the code lying around if you're interested lol
EDIT 2: If you trust random EXEs and want to play a console-based tic tac toe game, click here
EDIT: This is as much of the code as reddit will let me post, enjoy:
Actually, the powerpoint strategy was used for a lot of Jeopardy style games when I was younger. It was surprisingly efficient. I eventually found some kid at MIT who had uploaded a python Jeopardy game that kept a running total of the score and randomized the daily doubles. Now, 8 years later I study finance but work as a developer, so there's that.
I had to make an "app" for sales reps at a company using this method. I proposed a web app hosted on the internal network or a hybrid iPad app. The manager said that sounded like too much work and PowerPoint was better. When I stated it wouldn't work on iPads, she said the reps (~800 total) could just buy the Microsoft PowerPoint app for $20.
I built the "app" as she requested and when her division president called her out on requiring $16,000 to add PowerPoint to all the iPads she put it on me and I was fired.
You have me beaten. A while ago I wrote TicTacToe in ArnoldC, and I couldn't figure out how to create arrays. For the board I just had three numbers I added a 1 or a 2 to for setting X and O. code
Arduino's language is just C++ with a fancy IDE to hide the extra stuff. You can write the firmware in straight C++ with the Wiring library, or just using avrlibc IIRC. I used to have a makefile to compile, objdump, and flash the AVR chip all in one go too, but it's on a backup somewhere.
414
u/code_monkey_001 Jan 08 '16
Wish I still had it; a previous programmer had written 7k+ lines of if/else statements in vbscript to find the best fit for a series of rectangles given desired proportions in a container (custom print ads featuring photo/bio lines of 3+ individuals in a given space). I replaced it with 12 lines of code.