2
votes
5answers
217 views

Incremental Betting

Several months ago I had this question as a pre-screening puzzle for an interview. Recently when thinking about blog material, it popped in my head as a good example to use for solving a problem ...
10
votes
2answers
146 views

Create a Flood Paint AI

In the game of Flood Paint, the goal of the game is to get the entire board to be the same colour in as few turns as possible. The game starts with a board that looks something like this: 3 3 5 4 1 ...
-11
votes
0answers
66 views

Show display error for specific ip address in wamp server [on hold]

I'm working at gaint project which is share between developers the project is place at one computer and we are accessing it through the network localy we're using wamp server now in wamp display error ...
18
votes
0answers
311 views

Musical Tweet Challenge

This is the audio version of the Twitter image encoding challenge. Design an audio compression format that can represent at least one minute of music in 140 bytes or less of printable UTF-8-encoded ...
11
votes
4answers
301 views

Shortest representation of an Underload number

Flavour text The stack-based esolang Underload has some interesting ties to functional programming. One of them is its treatment of the numerical datatype—like the lambda calculus, you ...
-4
votes
0answers
58 views

Return nth letter from a file [on hold]

Using only the standard libraries of the programming language, write a program to do the following: Accept two inputs: a text file and an arbitrary positive integer n. Returns the nth letter from a ...
7
votes
1answer
93 views

Build a minifloat adding machine using NAND logic gates

A minifloat is a binary representation of a floating-point number that has very few bits. The minifloat in this question will be defined as an 6-bit number m, which has the following representation: ...
-5
votes
4answers
132 views

Count like Chuck Norris [on hold]

It is a proven fact that Chuck Norris counted to infinity twice. Inspired by admiration for this achievement, I tried to write a program to reproduce the steps that one would require to count to ...
-4
votes
10answers
144 views

The else statement replacement in the fewest bytes? [on hold]

Problem The else statement, found in most languages is not needed, we must find alternatives. Use an if statement with some work-around code to avoid using the else keyword. Winner The winner is ...
-4
votes
0answers
70 views

Shortest interpreter for any language [on hold]

This is pretty simple. Write an interpreter for any language in any language. Rules Shortest one wins. No "blank interpreters". (like ) No interpreters for joke languages. (e.g. HQ9+ and HQ9++)
-5
votes
1answer
82 views

Return nth digit in a number - Objective-c [duplicate]

Let's say I have a number like 134658 and I want the 3rd digit (hundreds place) which is "6". What's the shortest length code to get it in Objective-C? This is my current code: ...
12
votes
8answers
473 views

ASCII ART edge detection

As the title says, I was thinking to contest in which one must detect edges of an ASCII art. The code should accept a B/W ASCII art as input. A B/W ASCII art is defined as (by me) an ASCII art with ...
3
votes
2answers
261 views

Thwarting the Fry King

Setting The Fry King is a small criminal mastermind from the western european nation of Belgium, more specifically Flanders. He has acquired every single fastfood restaurant in a large part of ...
14
votes
3answers
493 views

Hunt the Wumpus

When I was a lad, kids would wander into computer stores and play Hunt the Wumpus until the staff kicked us out. It was a simple game, programmable on the home computers of the mid-1970s, machines so ...
12
votes
10answers
1k views

Line up the CSV

Overview: Your job is to take CSV input in key=value format and line it up in a more organized (see below) way. Input: Always via stdin. Records will always be in the following form key=value: ...
10
votes
7answers
705 views

Almost Equilaterial Heronian Triangles

An Almost Equilateral Heronian Triangle is a triangle with integer lengths of the form n-1, n, and n+1 and also has integer area. The first few are: 3, 4, 5 -> 6 13, 14, 15 -> 84 51, ...
22
votes
31answers
6k views

Help!! How to do square root!

Hi guys, for my class I need to make a number square root but it doesnt work !!HELLPP! The challenge: Write a function or program that will "make a number square root". Note: This is code ...
-3
votes
4answers
192 views

print text with no chars

Mission is write a program that prints "Hello World!". Simple? Text must be human readable and should not be "|-| € |_ |_ 0 // 0 |? |_ |) \./" or something like that Program should not contain: ...
7
votes
0answers
116 views

Program that permutes itself to encode a string (quine-variant)

Write a program that prints the following 80-character line: This program from codegolf.stackexchange.com permutes itself to encode a string. then accepts one line of input, then prints its ...
13
votes
3answers
255 views

The Easter Egg Hunt on the Hill

Easter Egg Hunt Bot find egg before bunny find egg. Bot happy. Overview This is a king-of-the-hill challenge in honor of Easter and the Easter egg hunting tradition! Your bot has a vision of two ...
1
vote
1answer
79 views

Convert image pixels to quadruples [on hold]

Example given an image which width and height is a power of two . First step : Divide each image into Cartesian coordinate quadrants _____ _____ | | | | 2 | 1 | |_____|_____| | | ...
8
votes
1answer
180 views

Where will the ball land?

Given a string where the first line contains spaces and one period (., the "ball"), followed by lines containing spaces, forward slashes (/), and backslashes (\), determine what column the ball will ...
20
votes
5answers
1k views

Draw the shadows of buildings

Input: 1 X X X X XX XXXXXX X X X X XX XXXXXX ...
4
votes
0answers
76 views

Using dictionaries, thesauruses, and similar databases, construct as large of a “See also” loop as possible [on hold]

As I'm sure many of you know, synonyms can range from very similar to not-so-similar-but-I-can-see-how-it's-similar. It's common for dictionaries to use "See also" to denote occurrences of words that ...
4
votes
10answers
420 views

Find all reachable nodes in a graph

You are given a directed graph in an adjacency dictionary format. This can be whatever format is most natural for your language. For instance, in python, this would be a dictionary with keys of nodes ...
-4
votes
0answers
93 views

Fun & simple puzzles/games for kids [closed]

I'm going to be running a week-long programming 'camp' this summer for a group of middle school students and am trying to brainstorm some fun ideas. We'll meet four hours a day for five days, and none ...
8
votes
6answers
690 views

Shortest code to sort walking points

The challenge is to, given a list of points, sort in a way that, when they are connected in this order, they never intersect. Input format (read from stdin): X Y 1 2 3 4 5 6 ... Output should be ...
-2
votes
0answers
59 views

Selecting movie times at the cinema [closed]

Suppose that I am planning a trip to the cinema. I have a list of n movies (where n > 2) that I want to see, along with lists of their start times and lengths, and an idea of how long the ads and ...
-4
votes
6answers
100 views

Remove Duplicates From One List [closed]

Task: Remove all duplicates from one list. This is a [code-golf] challenge, so shortest answer wins! You only have to remove the duplicates and present it in a form of a list. You don't have to output ...
29
votes
13answers
3k views

Maze Generation

I know there is an (old) thread similar to this (here), but I'd like to reboot it with some modifications. The goal: generate a random-looking maze using an algorithm of your choice, then output the ...
-6
votes
3answers
158 views

Challenge to generate a mathematical sequence [closed]

I challenge you to generate the following sequence. 1 2 3 4 5 11 17 23 29 35 76 117 158 199 240 281 603 925 1247 1569 1891 2213 ......N Th term N will be only Input in your code(Any Language) ...
19
votes
23answers
3k views

Valid Through The Ages

Inspired by this question on SO, your task is to produce a program that is valid in (at least) two major versions of your chosen language that produce different output. Rules Any language that has ...
40
votes
7answers
1k views
+200

Hunger Gaming - Eat or Die

Hunger Gaming - Eat or Die If you don't eat, you die. If you eat, you live (until you die). You will die, so try to die last. Overview There is an island populated with a herd of prey animals. You ...
153
votes
51answers
15k views

Survival Game - Create Your Wolf

The Board The Board is a two dimensional array of cells. Cells are populated by Animals. Every day, all Animals on the Board simultaneously make one move. If two or more Animals move to the same ...
81
votes
106answers
16k views

4, 8, 15, 16, 23, 42

4, 8, 15, 16, 23, 42 Write a program that outputs this sequence of numbers infinitely. However, The Numbers must not appear in your source code anywhere. The following is not a valid Java program to ...
5
votes
0answers
129 views

Turtle Graphics Version 2

Most of you have probably heard of the famous Turtle Graphics program, initially made popular by Logo. This challenge is to implement a Turtle Graphics program in your language of choice. Rules: ...
75
votes
139answers
9k views

Execute prints backwards

Your task is to reverse the order in which some prints get executed. Specs: Your code will be in this form: //some lines of code /*code*/ print "Line1" /*code*/ /*code*/ print "Line2" /*code*/ ...
2
votes
0answers
444 views

Partition a map of water flows

This is a challenge on the internet asked by Palantir Technologies in their interviews. A group of farmers has some elevation data, and we’re going to help them understand how rainfall flows ...
19
votes
21answers
2k views

Convert a repeated decimal to a fraction

This question doesn't need to apply to just terminating decimals - repeating decimals can also be converted to fractions via an algorithm. Your task is to make a program that takes a repeated decimal ...
31
votes
72answers
5k views

Shortest code to produce infinite output

Write the shortest code you can that produces an infinite output. That's all. You code will only be disqualified if it stops producing output at some point. As always in code golf, the shortest code ...
2
votes
0answers
309 views

Simple chess bot

Inspired by this Implement simple chess bot (with console or GUI) that has following features: [Pseudo-]graphically showing the board; Accepting user moves and making their own moves; Playing by ...
100
votes
50answers
17k views

Print every character your program doesn't have

Your task is to build a program (using only printable ASCII characters and/or tabs and newlines) that prints out exactly the characters in the printable ASCII space (0x20 to 0x7e) that don't appear in ...
5
votes
5answers
782 views

Build a solver for the cow and chicken problem

The cow and chicken problem is a traditional problem for introducing young students to the concept of systems of equations. It goes as follows: A farmer raises cows and chickens on his farm. His ...
5
votes
0answers
371 views

chess - calculate all legal moves from fen string ignoring castling and en passant

Write the shortest code that calculates all possible (legal) moves of current player from a given FEN string. What is FEN string? (Wikipedia) Shortest code wins, language doesn't matter. Output ...
29
votes
9answers
1k views

Write a polyglot that prints the language's name

The task is to write a code which compiles in as many languages as possible, in as few characters as possible. To avoid trivial solutions, the program must print the name of the language it is ...
2
votes
0answers
359 views

Splitting goods among people so that everyone feels happy

A favorite puzzle of mine: There are n people and k goods. The goods can be arbitrarily split (let's imagine they're different raw metals, for example). Your task is to split them among those n people ...
15
votes
6answers
2k views

Recreate a 'Snake' game in a console/terminal

Games are fun this codegolf here was so fun I had to make a version for other classic games similar in complexity. Shortest Way of creating a basic Space Invaders Game in Python This time, however, ...
36
votes
7answers
3k views

Robot Finds Kitten

The challenge The shortest code by character count to help Robot find kitten in the fewest steps possible. Golfers, this is a time of crisis - Kitten gone missing and it's Robot's job to find it! ...
56
votes
42answers
7k views

Tips for golfing in Python

What general tips do you have for golfing in Python? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Python (e.g. "remove comments" is ...
63
votes
77answers
4k views

Code Golf Christmas Edition: How to print out a Christmas tree of height N

Given a number N, how can I print out a Christmas tree of height N using the least number of code characters? N is assumed constrained to a min val of 3, and a max val of 30 (bounds and error ...

15 30 50 per page