Skip to main content

All Questions

Filter by
Sorted by
Tagged with
34 votes
4 answers
3k views

Make The Finest Magic Code Square

In math a magic square is an N×N grid of numbers from 1 to N2 such that every row, column, and diagonal sums to the same total. For example here's a 3×3 magic square: In this challenge we'...
Calvin's Hobbies's user avatar
2 votes
3 answers
269 views

Writing Phrases with Code [closed]

This is my first contest, so please tell me what I can do to improve. The object of this contest is to write program lines in your language of choice that are both valid code and self-descriptive in ...
Josiah Winslow's user avatar
5 votes
1 answer
846 views

Let us create a sonnet quine! [closed]

There are programs that will output its source code to standard output and do nothing else. They also access no external output. This type of program is known as a quine, and is a common code ...
Christopher King's user avatar
10 votes
5 answers
1k views

Program that prints mirror images of it's own self

Write a program that produces mirror images of itself. An example, would be the fantastic camel code that reads it's own code and produces two smaller 2x2 versions. Given the input: ...
devnull's user avatar
  • 1,611
63 votes
38 answers
9k views

Factorial in haiku!

Task Create a program that calculates the factorial of a number using no built-in factorial functions. Easy? The catch is that you must write your entire program (including testing it) in haiku form. ...
TheDoctor's user avatar
  • 7,981
19 votes
15 answers
2k views

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

In my previous code challenge, I asked you to write a function that tells you which of its lines has been removed. The instructions were: Write a function that contains five lines. If you run ...
jawns317's user avatar
  • 1,152
29 votes
13 answers
2k views

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 ...
jawns317's user avatar
  • 1,152
14 votes
7 answers
997 views

Avoid duplicate entries using a sign change

This anecdote contains the following intriguing exchange: "Fine, Fred," Avi interrupted. "Then how would you change this to avoid duplicate entries?" "Oh, just change that one there to a ...
histocrat's user avatar
  • 22.3k
19 votes
18 answers
3k views

Write a program that is valid after circular character shift

Potentially very difficult, but I've seen some amazing things come out of this site. The goal is to write a program, in any language, that does whatever you want. The catch is that the program must ...
Griffin's user avatar
  • 4,775
126 votes
21 answers
18k views

Write a program that always outputs "2012" - even if it's modified!

This idea is not mine, though I don't know where it originated. I once met it in a programming contest very long ago (1998, if I remember correctly). The task is to write a program in your favorite ...
Vilx-'s user avatar
  • 1,621