All Questions
1
vote
0answers
58 views
Mozart golf - mini “Rondo”
Output "Mozart - Alla Turca" to stdout (see the sample for "reference implementation")
Try to find how to pack both synthesizer and the music into minimal size.
Requirements:
Format suitable for ...
26
votes
30answers
1k views
Do something that looks like something else
Write a snippet, a function, a programm, ... that is obfuscated in a way that it looks clear at the first sight that it does something else.
For example: write a bit of code that adds two number, but ...
6
votes
3answers
237 views
Display a bézier curve in the browser
The goal is to display a bézier curve in any classical browser (except maybe old IE versions, because... are they really browsers?) client side.
Rules:
You must provide one or more files (or their ...
19
votes
6answers
654 views
Fault-Tolerant Hello World (a.k.a. the Interview)
At the end of your interview, the Evil Interviewer tells you, "We make all of our applicants take a short coding test, to see if they really know what they are talking about. Don't worry; it's easy. ...
9
votes
11answers
411 views
Write the shortest self-identifying program (a quine variant)
Write a program that will generate a "true" output iff the input matches the source code of the program, and which generates a "false" output iff the input does not match the source code of the ...
4
votes
11answers
301 views
Meta Length Logarithms
Good Evening Golfers,
Your challenge, this evening, is logarithmic, and (as Abed would put it) "Meta"
Your goal is to write a program that takes an input from stdin or the command line, and returns ...
22
votes
24answers
2k views
Print a string in as few distinct characters as possible
The task is simple: print The quick brown fox jumps over the lazy dog using as few distinct characters in your source code as possible.
print "The quick brown fox jumps over the lazy dog" has a score ...
7
votes
4answers
272 views
Generate a golfed program to evaluate an arithmetic expression
Your task is to write a program that will take input like this:
a + b * c + a / 2
and will generate the source code for a program that takes user input and then evaluates the expression.
The ...
1
vote
0answers
160 views
Alex the Truck Driver
Alex is a Truck Driver who wants to find the quickest way to deliver goods to multiple cities. He knows the distances between his destinations, but you need to write a program to help him find the ...
3
votes
19answers
392 views
print this multiplication_table
Write shortest code to print the following multiplication_table:
1×1=1
1×2=2 2×2=4
1×3=3 2×3=6 3×3=9
1×4=4 2×4=8 3×4=12 4×4=16
1×5=5 2×5=10 3×5=15 4×5=20 5×5=25
1×6=6 2×6=12 3×6=18 4×6=24 ...
7
votes
4answers
375 views
Lawnmower Patterns
Taken from Google Code Jam 2013 Qualification Round Problem B:
Alice and Bob have a lawn in front of their house, shaped like an N metre by M metre rectangle. Each year, they try to cut the lawn ...
-2
votes
0answers
74 views
Trim both sides of a line [closed]
On Stack Overflow
a user wanted to trim both sides of a line using sed. I came up with this solution, which I quite like
$ cat foo.txt
INVITE sip:[email protected]:5060 SIP/2.0
Result
$ ...
0
votes
3answers
145 views
Hello World socket server
Write the shortest program that answers "Hello, World" to a network connection.
Conditions:
Program shall listen on port 12345
When a client connects, program shall write "Hello, World" to the ...
3
votes
9answers
325 views
Eight Queens Obsfucation
You've probably heard of the classic Eight Queens Puzzle. For those of you who haven't it goes something like this:
Position 8 queens on an 8×8 chessboard so that no two queens threaten
each ...
7
votes
3answers
229 views
Rosetta Stone Challenge: Draw a Box Plot
The goal of a Rosetta Stone Challenge is to write solutions in as many languages as possible. Show off your programming multilingualism!
The Challenge
Your challenge is to implement a program that ...