0
votes
0answers
30 views

Find the Bacon Number

Challenge Given the name of an actor, you must find their Bacon number. You must use IMDB, and if there are multiple actors of the same name, you must choose the first. You must only use the films ...
4
votes
1answer
73 views

Multiply two numbers without using any numbers

You are given as input two strings representing positive integers, such as "12345" and "42". Your task is to output a string containing their product, "51890" in this case. The twist is that you may ...
10
votes
3answers
142 views

Book Stack Sort

When stacking books you usually want to put the largest ones at the bottom and the smallest ones at the top. However, my latent OCD makes me feel very uneasy if I've got two books where one is shorter ...
4
votes
1answer
76 views

Python: I wish I was PHP

There's an old story about a stonecutter who was never satisfied with what he was. He wished he could become the sun, and so he was. Blocked by the clouds, he wished to be - and became - a cloud. When ...
23
votes
33answers
1k views

Write lines in detention

Introduction Bad news guys - you got detention. Your English teacher doesn't understand this site and wants you to "stop doing math on your digital dohickeys, this is English class!" She sentenced ...
5
votes
0answers
234 views

Circle packing in a rectangle

Your task is to write a program that finds the largest radius that N circles can have and still fit inside of a rectangle that is X by Y pixels large. (similar to this wikipedia article) Your program ...
8
votes
5answers
360 views

Jumblers vs Rebuilders: Coding with Tetris Bricks - Area for Rebuilder Answers

This is the companion question to Jumblers vs Rebuilders: Coding with Tetris Bricks where Rebuilders can post their solutions. As argued in Where should we put robbers? it allows more formatting ...
-1
votes
0answers
137 views

Write a brainfuck embedded DSL

It's 2014 and you're working for BigT€ch. Your boss Stefanus Anointer has been keeping an eye on the big trends in the tech industry and seen that the programming language BrainFuck has become quite ...
0
votes
0answers
176 views

Find a representative submatrix [on hold]

You have a matrix of size m x n. Each cell in the matrix has a (uniformly) random integer value v, where 0 ≤ v < i, and i ≤ (m x n). (Meaning, the matrix contains a maximum of m x n distinct ...
12
votes
17answers
3k views

The Ackermann function

The Ackermann function is notable for being the one of the simplest examples of a total, computable function that isn't primitive recursive. We will use the definition of A(m,n) taking in two ...
22
votes
15answers
2k views

Jumblers vs Rebuilders: Coding with Tetris Bricks

In traditional Tetris, there are 7 distinct tetromino bricks, each denoted by a letter similar to its shape. # # # # # ## # # ### ## ## # ## ## ## # ## ## I O ...
17
votes
8answers
1k views

Short Deadfish Numbers

Deadfish is one of the best known non Turing-complete programming languages. It has only one accumulator (which starts at 0) to store data, and only four commands: i - Increment the accumulator s - ...
-6
votes
1answer
157 views

Print Hamlet's monologue using as few characters as possible [duplicate]

The task here is to print the text below, using as few characters as possible in your code. You can't use any external resource. (file, stdin, network) To be, or not to be: that is the question: ...
16
votes
17answers
2k views

Sierpinski Carpets

Who doesn't love a good fractal? The Sierpinski Carpet is a classic example of a fractal. To complete this task, you will be required to generate a carpet of type and print the resulting image to ...
5
votes
7answers
2k views

Catch some drug dealers

(spoilers on decade-old TV show below) In the HBO show "The Wire", the dealers use a system of encoding phone numbers where they "jump the 5" on the number pad. +-----------+ | 1 | 2 | 3 | ...
0
votes
3answers
116 views

JavaScript: Tricks to shorten onkeydown, setInterval etc

Are there any tricks to shorten defined function names like setInterval, onkeydown, onkeyup, createLinearGradient or even return? When using it more than once it's nice to put it as a string into a ...
0
votes
2answers
76 views

Approximated (unsorted) square from a set of values [on hold]

So a colleaque came with this problem lately and I want to challange you to solve the problem in the code-golf style, shortest solution in any language wins. The Problem: Given is a random set of ...
34
votes
5answers
1k views
+100

Making Future Posts Runnable Online with Stack Snippets

Stack Snippets were recently added to PPCG! Reminiscent of JSFiddle, Stack Snippets allow HTML, CSS, and JavaScript to be run directly in posts! Here is a very simple Stack Snippet: alert('This ...
15
votes
3answers
903 views

Hungry Image Snake - Hole #3

Hole #1 Joe the snake is hungry. He eats pictures, one pixel at a time. He really likes bright pixels. The Challenge Program Joe to eat the most bright pixels he can find, given that he can only ...
39
votes
8answers
6k views

Draw the South Korean flag

When I stumbled upon this question I remembered that I had also once seen precise rules for the construction of the South Korean flag. And this is quite a different construction. Source: Wikipedia ...
12
votes
5answers
1k views

Tips for golfing in Pyth

Pyth is a Python-inspired procedural programming language, created by PPCG user isaacg. What general tips do you have for golfing in Pyth? I'm looking for ideas that can be applied to code golf ...
1
vote
4answers
101 views

Tips for Golfing in BBC BASIC

What general tips do you have for golfing in BBC BASIC? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to BBC BASIC (e.g. "remove ...
15
votes
1answer
428 views

Give me a haircut!

This is my head: \ /-- -| / -\ | | | \ \ \ \ | --\ | \ | | / |--| / / | /|- //--| / | | | || //\ | | \ /| // \ | It consists of exactly eight hairs. My hair ...
6
votes
1answer
364 views

Animating the Separation of Fluids by Density

Let the characters 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ represent the particles of 36 immiscible fluids, each more dense than the last. So the 0 fluid is the least dense and floats on all the others, ...
13
votes
5answers
1k views

Pixel art, episode 2: Display the map 1-1 of Super Mario Bros

Last challenge (Pixel-art, episode 1: display Super Mario) was just a training... (and you completed it in amazing ways, thanks!) This time, you have to work a little bit more. You have to display ...
13
votes
3answers
905 views

Write a square program that outputs the number of times it has been “unrolled”

Consider a square block of text, N characters wide by N tall, for some odd integer N greater than 1. As an example let N = 5 and the text be: MLKJI NWVUH OXYTG PQRSF ABCDE Notice that this is the ...
-1
votes
0answers
114 views

An expression in as few instructions as possible [closed]

( 7(x+2) + (y-1)/9 )^2 Solve this expression in as few assembly instructions as possible. I managed to do it in 9 instructions. x and y are declared in .data and are of type DWORD. Working with ...
5
votes
2answers
498 views

Draw a Golden Spiral!

Given a number n, you must output a golden spiral with the number of quarter turns being n. The spiral must be completely black and the background must be completely white. This must be output as a ...
35
votes
13answers
4k views

Programming with a Sporadic Shift Key

There's something wrong with your keyboard. The Shift key has a mind of its own. Every time you type a character you have no idea whether it will come out shifted or not (though it is 50-50). Besides ...
8
votes
8answers
469 views

Verify Magic Square

A magic square is a square array of numbers with side n consisting of the distinct positive integers 1, 2, ..., n² arranged such that the sum of the n numbers in any horizontal, vertical, or main ...
4
votes
1answer
230 views

Javascript: Mini Space Invaders

I'm pretty new to code golfing, so I gave one of my first shots to a space invader clone called "Invas!on". It's a little less than 500 bytes, fully ASCII generated, and covers moving around and ...
23
votes
20answers
5k views

Pixel-art, episode 1: display Super Mario

it's a-me! Today's task is simple: write a program, or a function that displays the idle small Mario sprite, from Super Mario Bros, on NES, over a blue background. Any kind of entry is valid as long ...
9
votes
2answers
312 views

What are you waiting for? (A mahjong solver)

Idea thanks to @MartinBüttner from a discussion in chat Mahjong is a tile game that is immensely popular in Asia. It is typically played with four players, and the goal of the game is to be the first ...
6
votes
1answer
233 views

Solve a Tetris Puzzle (pack predefined shapes into optimal form)

The challenge is about finding an optimal solution on how to place a number of given shapes. It is oriented on the principle of Tetris, where it is optimal to pack the given pieces as tight as ...
6
votes
4answers
416 views

Hole 2 - Prime Quine

Find Hole 1 here. Make a quine that, when run, outputs its own source code block multiple times. In fact, it must output it n times, where n in the next prime number. I think an example shows it ...
7
votes
2answers
740 views

Emulate the Professor's typing

Emulate the Professor's typing Background Unfortunately, the Professor is not able to use his keyboard properly: whenever he is meant to use the Shift key, he presses Caps Lock once before typing, ...
6
votes
2answers
363 views

Turn nouns into plurals

Your task is to take as input an English noun and output its plural. To win the challenge you must trade off code length against accuracy. Entries will be scored according to this comma-separated ...
56
votes
40answers
6k views

Cops and Robbers: Regex Golf

The Cops' Challenge You are to write a short, obfuscated regex, satisfying the following spec: You may choose any flavour that is freely testable online. There's a good list of online testers over ...
1
vote
1answer
318 views

Draw a Fractal in Under 200 Characters [closed]

After noticing all the fractal submissions/questions, I thought it would be fun to start a contest where everyone submits their favourite fractal. The Contest Generate a fractal in under 200 ...
19
votes
2answers
797 views

Generate Realistic Maps

I drew this map of the regions of an imaginary word in a few minutes in MS Paint: I think that being able to generate maps like this programmatically would be really cool. Challenge Write a ...
17
votes
7answers
2k views

Print all Country Codes

ISO 3166-1 is the standard that defines all the country codes. The well-known two-letter codes (US, GB, JP, etc.) are called Alpha-2 codes. With two letters, there are only 262 = 676 possible codes, ...
5
votes
6answers
524 views

I'm feeling lucky

Write the shortest function that returns the content of the first result of a google search ("I'm feeling lucky"). Exemple: lucky('cat'); returns something like: <!DOCTYPE html> ...
5
votes
1answer
294 views

Notes to Tablature

Challenge Given a list a notes, you must return the corresponding tablature. Notes The notes must be in the range of A to G inclusive and the octave range being 2 to 6 inclusive. The format is ...
4
votes
0answers
123 views

How to golf string output in Chef

I'm attempting to solve a programming golf style programming puzzle. I need to write an 18 character phrase in Chef in less than 32 "lines" of code. In this case, a line counts as an ingredient or an ...
58
votes
90answers
14k views

Sing Happy Birthday to your favourite programming language

Your favourite programming language has just had a birthday. Be nice and sing the Happy Birthday song to him (or her, if you will). Of course you should accomplish this by writing a program in that ...
11
votes
2answers
697 views

9 Holes of Code Golf - Kickoff

There has already been a 9 Hole Challenge (and another one here), but that was soooo last year. And besides, I have only been around for 2 months (although it seems like forever). And it is ...
23
votes
6answers
1k views

Swipe Type Converter

The next revolution in typing on laptops was released on the first of April, 2014 by SwiftKey. However, I want to be the first person to write a swiping nano clone, but, as I can't find a good ...
10
votes
4answers
355 views

Tips for golfing in CJam

CJam is a GolfScript-inspired stack-based golfing language, created by PPCG user aditsu. So, in the vein of other language-specific tips questions: What general tips do you have for golfing in CJam? ...
29
votes
2answers
904 views

Create xkcd-Style Narrative Charts

In one of the more iconic xkcd strips, Randall Munroe visualised the timelines of several films in narrative charts: (Click for larger version.) Source: xkcd No. 657. Given a specification of the ...
7
votes
2answers
182 views

Stabilize a Brick Structure

Bricks and Stability Defined This question uses the same definition of bricks and stability as Is the brick structure stable? Let [__] represent a masonry brick and . . ...

15 30 50 per page