-1
votes
0answers
69 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 ...
1
vote
1answer
93 views

Matrix sampling

You have a matrix of size m x n. Each cell in the matrix has a value v, where 0 ≤ v < i ≤ (m x n). (Meaning, the matrix contains a maximum of m x n distinct values, but it may have fewer.) Every ...
6
votes
12answers
914 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 ...
9
votes
7answers
754 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 ...
15
votes
7answers
861 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
113 views

Print Hamlet's monologue using as few characters as possible

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: ...
9
votes
16answers
1k 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
8answers
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
93 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
73 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 ...
29
votes
5answers
1k views

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 ...
14
votes
3answers
795 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 ...
37
votes
6answers
5k 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 ...
11
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
96 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
400 views

Give me a haircut!

This is my head: \ /-- -| / -\ | | | \ \ \ \ | --\ | \ | | / |--| / / | /|- //--| / | | | || //\ | | \ /| // \ | It consists of exactly eight hairs. My hair ...
6
votes
1answer
349 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, ...
12
votes
5answers
809 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
869 views
+100

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
106 views

An expression in as few instructions as possible [on hold]

( 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
481 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 ...
34
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
459 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
221 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
303 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
227 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 ...
5
votes
4answers
399 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
731 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
350 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
311 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 ...
17
votes
1answer
561 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
1k 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
522 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
285 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
121 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
89answers
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 ...
10
votes
2answers
659 views
+50

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
350 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
895 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
180 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 . . ...
7
votes
11answers
565 views

Bulgarian Solitaire

Bulgarian Solitaire is a single-player game made popular by Martin Gardner in his mathematical column in Scientific American. You have N identical cards, split into piles. You take a card from each ...
10
votes
9answers
1k views

Calculate the troll toll to safely pass

Inspired by http://puzzling.stackexchange.com/q/626 In your adventures you arrive at a series of 7 bridges you have to cross. Underneath each bridge lives a troll. In order to cross the bridge, you ...
3
votes
8answers
442 views

Golfing the Core

Note: although this is tagged as Python, other languages are permitted Challenge What you have to do is write the shortest functions to perform the same actions as the following Python 2 built in ...
-5
votes
2answers
152 views

Unique code generation [closed]

As input, you are given a positive integer n. Output a code in response. Each n should generate a unique code. There are some constraints on the code that it outputs: The code must be 7 or more ...
13
votes
1answer
370 views

Sabotage a Train to Make It Run Late

"I want to go to the Araby bazaar to buy a present for the one I have fallen in love with. However, if I arrive too late all the stores will be closed and I won't be able to buy anything. Can you help ...
6
votes
3answers
498 views

Riemann Series Theorem

The Riemann series theorem states that the terms of a conditionally convergent series can be permutated such that the resulting series converges to an arbitrary value. The Challenge Write a program ...
20
votes
8answers
2k views

Prolific Perfect Pangram Programs Pertaining to Printable ASCII

Updates: Time limit removed. You must be able to describe output - see new rule. A pangram is a sentence that uses every letter in the alphabet at least once, such as: The quick brown fox ...

15 30 50 per page