All Questions

Filter by
Sorted by
Tagged with
40
votes
8answers
3k views

Lazy battleship placement

Imagine the following scenario: you are playing battleships with a friend but decide to cheat. Rather than moving a ship after he shoots where your ship used to be, you decide not to place any ships ...
10
votes
2answers
551 views

Robots! Collect these pickles!

I seem to have gotten myself into a bit of a pickle. Literally. I dropped a bunch of pickles on the floor and now they're all scattered about! I need you to help me collect them all. Oh, did I mention ...
-2
votes
18answers
1k views

Shortest program to print “:)” until the end of time [duplicate]

Task: Make a program that prints a smiley (:)) indefinitely. Rules: Your program must print :) as fast as possible until ...
3
votes
11answers
2k views

Shortest program that displays a red 3D cube [closed]

Write the shortest program you can that displays a red 3D cube. Rules: The cube must be red, have 6 rendered sides, and be displayed in 3D. Your program cannot load any textures. More than 1 side ...
23
votes
4answers
3k views

Implement ROT-47… in ROT-47

Challenge: Implement ROT-47 in code that works as both itself and as the ROT-47 version of itself. Scoring: Your score is calculated as a percentage of used, ROT-47 eligible bytes in total of both ...
4
votes
1answer
518 views

Validate input according to flags and input masks

This challenge challenges you to write a function that will take as its argument an array that specifies the types of input, an optional prompt, and a verification key; inputs and validates the values;...
41
votes
50answers
12k views

Most creative way to reverse a positive integer [closed]

Provided an input as an unsigned integer: 13457 Your function/subroutine should return: 75431 Since this is a popularity ...
12
votes
2answers
605 views

Implement a reversi engine

Your job, for this golf, is to write a program that will take moves of a game of reversi (othello) and display the result to the user. Input A string of numbers taken from the range [0-7]. Each pair ...
8
votes
5answers
2k views

DVORAK Keyboard layout

Here's an interesting challenge... I want you to golf code than when executed will allow your input to be converted to mimic output as though you were typing on a DVORAK keyboard layout. The aim is ...
21
votes
11answers
1k views

Cross-matching regular expressions

Your task here is to write two regular expressions, each of which matches the other one but does not match itself. Both regular expressions should have this form: ...
9
votes
15answers
2k views

Random without Time-Basis [closed]

Computers do not out-of-nowhere create random numbers without basis, as most likely, time is the universal basis of randomness. I want you to create a code that creates random numbers with these ...
10
votes
5answers
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: ...
20
votes
2answers
4k views

Draw the Utah Teapot

The Utah teapot, originally created by Martin Newell, is a convenient object for testing 3D graphics programs. The task is to create a wireframe image of the teapot in perspective projection. To ...
8
votes
19answers
4k views

Approximate a Bell Curve

Create a program to display some approximation of a bell curve. You are free to use whatever method you wish for generating the data, but the data must be displayed vertically, as in oriented like so: ...
13
votes
1answer
903 views

Brainf**k Debugger

Your challenge is to take input like this (a Hello World program): ...
12
votes
6answers
3k views

Solve a System of Linear Equations

Write a program to solve a series of linear equations as short as possible. It must solve arbitrary number of equations problems. They can inputted however you like, coefficients of augmented matrix ...
12
votes
7answers
983 views

Acronym to phrase

Task: Create a program that will take an acronym as input, for example dftba, and generate some possible phrases that the acronym could stand for. You can use ...
65
votes
55answers
74k views

Weirdest obfuscated “Hello World!” [closed]

Task: Create an obfuscated program that prints Hello World! (exactly like that). Your program may not have any strings in it. Rules: You can use any programming ...
15
votes
3answers
1k views

The Tic-tac-toe Games

Create a deterministic program to play nd tic-tac-toe with the other contestants. Your program should work when n (width) and d...
-7
votes
6answers
513 views

Extract name of website from an absolute URL [closed]

You will take input such as http://examples.example.co.nz/abcdefg and return the name of the website, in which this example would be example. To be more specific,...
14
votes
17answers
2k views

Break some standards! [closed]

Everyone knows the phrase "Rules are made to be broken!", so here is your task: Write some code in any language that breaks a standard. This can be anything, from putting 240 volts down a USB cable, ...
79
votes
78answers
14k views

Call a method without calling it [closed]

Inspired by a now deleted StackOverflow question. Can you come up with a way to get a particular method executed, without explicitly calling it? The more indirect it is, the better. Here's what I ...
19
votes
10answers
3k views

Create a programming language interpreter [closed]

Task: You must create an interpreter that can parse snippets of a programming language. The language does not need to be complex, but it must include the following syntactical elements: Ability to ...
12
votes
20answers
1k views

Determine if an integer is a palindrome in a given radix (base)

Write a program that reads from stdin two integers, each newline terminated, hereafter called "number" and "radix", and: Prints any fixed message you want if the number is a palindrome in that radix (...
2
votes
2answers
785 views

Get as close to pi as you can [closed]

Your job is to write a program to find the closest number to PI. Let me clarify. You will first choose a number type. Let us say you choose ...
21
votes
20answers
5k views

Create a sudoku solution CHECKER

Create a Sudoku solution CHECKER There are oodles of Sudoku SOLVERS here, but I want you to create a solution CHECKER as small as humanly possible (code-golf). A valid entry will be able to either ...
20
votes
6answers
3k views

Parallel projected voxel terrain generator

Your job is to generate a heightmap and show it as a parallel projected, voxel landscape. The rules are the following: The (heightmap of the) landscape has to be randomly generated You also have to ...
17
votes
3answers
1k views

Implement the game of life in 3D

The challenge is to find the shortest implementation of the game of life in 3D (example). These are the rules: Cells (in this case, cubes) with only 1 or less neighbours die, as if by lonliness. If ...
2
votes
1answer
544 views

Determining part of speech of most words [closed]

Write a program to output the part of speech of any word inputted to it. I doubt that anyone could get a perfect algorithm, so I will give the code a batch of words in order to ascertain what ...
16
votes
10answers
7k views

Crash (i.e. cause the interpreter to stop working and force close) Python [closed]

I would like to see who can make Python have a fatal crash with the most creative code. This means that when the program runs, Windows for example, will take over and pop up with something like “IDLE ...
51
votes
69answers
21k views

“Creative” ways to determine if an array is sorted

Given an integer array, write a program that determines if it is sorted in ascending order. Remember that this is a code trolling question. I am looking for most interesting ways that people come up ...
19
votes
11answers
1k views

Crash IRB (interactive Ruby)

Ruby comes with a built-in REPL, which is quite handy. Your challenge is to crash it in the least amount of code! The definition of "crash" is "make it exit in an unintended way." This means ...
12
votes
12answers
3k views

Calculate n Kaprekar Numbers

A Kaprekar number is an n-digit number k that, when the first n or n-1 digits of k^2 are added to the second n the digits of N^2, the result is N. Examples: ...
9
votes
2answers
459 views

Convert calendar dates to week dates and vice versa

Your mission is to write a program that accepts a date in the formats 2014-02-27 (calendar date) and 2014-W09-4 (week date) from ...
14
votes
21answers
999 views

Finding Local Extremes

Write a function or program that takes in a list and produces a list of the local extremes. In a list [x_0, x_1, x_2...] a local extreme is an ...
15
votes
2answers
2k views

king + rook vs king

It's the ending of another well played chess game. You're the white player, and you still have a rook and your king. Your opponent only has his king left. Since you're white, it's your turn. Create a ...
49
votes
13answers
2k views

Magrathea 2.0 - Building Mountains

With the big crash of the universal economy also the demand for custom made planets plunged. The Magratheans had to look after more steady revenues also from a broader class of customers. Therefore, ...
1
vote
4answers
4k views

More coding expressions like while(!(succeed = try()))? [duplicate]

I am looking for either suggestions or examples of more famous sayings written in code! If you have a website or database of them, please link that below your favorite one! Examples: ...
13
votes
3answers
999 views

Create an n to the d tic tac toe win-checker

Create the shortest program to check who has won in an nd tic tac toe game. Your program should work when n (width) and d (...
15
votes
9answers
2k views

Implement arbitrary precision division

Implement a function divide(int a, int b, int c) that prints the base 10 value of a/b. without using any floating point math nor ...
437
votes
49answers
155k views

Images with all colors

Similar to the images on allrgb.com, make images where each pixel is a unique color (no color is used twice and no color is missing). Give a program that generates such an image, along with a ...
2
votes
5answers
464 views

Infinite Boolean Matrix [closed]

It's geeky to see a Boolean Matrix animation, but a live one would be better. Echoing only 1s and 0s create a program that ...
13
votes
5answers
1k views

Hide a Brainf*** greeting in other code

The goal is to write a program (anything except explicit brainfuck) which prints Barney Stinson's best rule: New is always better. when interpreted normally, but Legen... wait for it... dary! ...
-5
votes
2answers
772 views

Make a golfing language [closed]

In this challenge, you get to create a language. Although you have to provide code in other languages, you will only be rated based on the language. Here are the requirements. You must invent a ...
17
votes
68answers
9k views

Pi Calculation Code Golf [closed]

The Challenge You must calculate pi in the shortest length you can. Any language is welcome to join and you can use any formula to calculate pi. It must be able to calculate pi to at least 5 decimal ...
1
vote
15answers
2k views

Random number generation, without built-in random number generation libraries [duplicate]

Task: Make a random number generator. The catch is that you can't use any built-in randomness functions. Your random numbers must be anything between 0 and 100, though they do not have to be floating ...
7
votes
4answers
983 views

Turing-Complete polyglot [closed]

Write a polyglot (code that works in two or more languages) that has a "mid-section" that can be modified to do any computational task. This question is similar to https://stackoverflow.com/questions/...
14
votes
5answers
28k views

Convert degrees to one of the 32 points of the compass

The 32-point compass is... interesting, to say the least. By Denelson83 (Own work) [GFDL or CC-BY-SA-3.0], via Wikimedia Commons Your challenge is to take a degree measure, and convert it into a ...
14
votes
2answers
651 views

Crossword Compulsions!

Chris, a cryptic crosswords addict, has a set algorithm for the order in which he solves them. We will use the above image as a guide. Chris always starts off with the first across clue, in this ...
3
votes
2answers
200 views

Reverse Regular expressions [closed]

The idea here is to write a little segment that will spit out regular expression patterns when given a string that matches them. As you might have guessed, this will be a popularity contest, and I'll ...

15 30 50 per page
1
203 204
205
206 207
237