This tag is in the process of being replaced with [programming-puzzle] and [puzzle-solver]. Please don't use it on new questions.

learn more… | top users | synonyms

2
votes
24answers
1k views

Count how many characters are in the program's source

Write a program that counts and prints the number of characters in it's own source code to standard output. The number must be generated from counting the characters. This Ruby solution would not be ...
16
votes
1answer
741 views

Android Lock Screen

Intro You are sitting in a board room at the end of a long table. You look around and see Tim Cook, the Apple Board of Directors, the ghost of Steve Jobs, and Jack Donaghy. Apple has called this ...
29
votes
9answers
3k views

Kolmogorov-mania

The Kolmogorov complexity of a string s is defined as the length of the shortest program P that outputs s. If the length of P is shorter than the length of s, then s is said to be compressible, ...
5
votes
6answers
521 views

Finding n'th character in a Lucky String

Lucky numbers are those numbers which contain only "4" and/or "5". For example 4, 5, 44, 54,55,444 are lucky numbers while 457, 987 ,154 are not. Lucky number sequence is one in which all lucky ...
3
votes
4answers
595 views

Obtaining ordering of cards [closed]

You are given a deck containing n cards. While holding the deck: Take the top card off the deck and set it on the table Take the next card off the top and put it on the bottom of the deck in your ...
-12
votes
3answers
570 views

Swapping numbers, the shortest code wins [closed]

The goal is to swap 2 numbers. The shortest code wins. Temporary variables are not allowed You can manipulate only one variable at a time One of the variables may be 0
4
votes
3answers
214 views

Update All with O(1) [closed]

Create a data structure to represent an array. It must implement those function in O(1) get(index); // return the data at @index update(index, value); // update the data at @index to ...
0
votes
3answers
161 views

Permutable functions [closed]

In your favourite programming language, write two functions f and g such as f(g) gives the same (not trivial) result as g(f), but f and g are different (signifiant changes, not only trivial ...
3
votes
5answers
565 views

(Python) Implementing incrementation

Challenge: Implement incrementation without addition, multiplication, exponentiation, and any higher binary operators (and their opposites) in Python. Winner is the person who can do it in the least ...