Programming Puzzles & Code Golf newsletter

Top new questions this week:

I need a program where the user inputs an array of doubles and the program outputs the array sorted

Note: This question was severely edited since I first posted it here. The rules were moved to here, read them before posting any answer to understand the purpose of this. This was the first question …

code-challenge popularity-contest code-trolling  
asked by Victor 240 votes
answered by Victor 145 votes

9 Hole Challenge

edit: Due to the awesome response and the unhappiness from the folks who closed this question, it's going to take me a while to modify and mark the rest of the submissions. See you soon! The 9 Hole …

code-golf math algorithm ascii-art  
asked by Dan Prince 44 votes
answered by AsksAnyway 8 votes

Produce the number 2014 without any numbers in your source code

So, now that it's 2014, it's time for a code question involving the number 2014. Your task is to make a program that prints the number 2014 without using any of the characters 0123456789 in your …

code-golf  
asked by Joe Z. 38 votes
answered by Quincunx 30 votes

How do I write an adding function?

The problem: I am the lead developer for a big company, we are making Skynet. I have been assigned to Write a function that inputs and returns their sum RULES: No answers like …

popularity-contest code-trolling  
asked by scrblnrd3 34 votes
answered by ProgramFOX 49 votes

Shortest code to print a smiley face

Requirements For the sake of the challenge let's define a unit: A unit is defined as any point that compose the grid in which the face is drawn (pixels for screen, characters for ASCII art, …

ascii-art popularity-contest  
asked by Jefffrey 31 votes
answered by avall 56 votes

How do I find the longest palindrome in a string?

The challenge: Make a function that finds the longest palindrome inside a string. Note: This is a code-trolling question. Please do not take the question and/or answers seriously. More …

code-trolling  
asked by Joe Z. 30 votes
answered by tomwilde 17 votes

Write a function that tells you which of its lines has been removed

Write a function that contains five lines. If you run the function as-is, it should return 0. If you remove any one of the five lines and run the function, it should tell you which of the lines has …

popularity-contest function  
asked by jawns317 20 votes
answered by histocrat 16 votes

Greatest hits from previous weeks:

Shortest code that return SIGSEGV

Shortest code that returns Segmentation Fault (SIGSEGV) in any programming language.

code-golf  
asked by Arya 7 votes
answered by GlitchMr 20 votes

Solve Rubik's cube

Write the shortest program that solves Rubik's cube (3*3*3) within a reasonable amount of time and moves (say, max. 5 seconds on your machine and less than 1000 moves). The input is in the format: …

code-golf algorithm  
asked by aditsu 17 votes
answered by aditsu 13 votes

Can you answer these?

Implement the Universal Machine emulator

The goal is to write a full program that emulates the Universal Machine from ICFP 2006 with the shortest code. The Universal Machine has a very simple instruction set explained here. The emulator has …

code-golf interpreter  
asked by mniip 1 vote

Sunrise and sunset

I'm a bit of a romantic, I love taking my wife out to see the sunrises and sunsets in the place we are located. For the sake of this exercise let's say I don't have code that can tell me the time of …

code-golf math  
asked by Eliseo d'Annunzio 7 votes

Hide evil code - print files containing a given string anywhere in a directory tree

Note: This is a code-trolling question. Please do not take the question and/or answers seriously. More information here. The point of this puzzle is to learn how a malicious code can be hidden and …

popularity-contest code-trolling  
asked by Petr Pudlák 1 vote
Subscribe to more Stack Exchange newsletters


Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3