0
votes
0answers
4 views

Generate symmetric groups

The goal The aim is to make a program that will generate the Sn matrix, where Sn is the n-th symmetric group. It is basically a permutation matrix. For example, this is S3's matrix : The ...
2
votes
0answers
59 views

Syllabify English words - kind of

You're tasked with writing a program that syllabifies words in a string of text, by separating them with a hyphen. That would be a lot of work, so you want to skip some parts, mainly because you don't ...
-1
votes
0answers
61 views

Populating the screen with cubes [on hold]

The challange is simple, you must draw 125 equal cubes on the screen in the shape of a huge cube. To be more precise x,y,z of the cubes should be the ones obtained from this python code (or multiples ...
3
votes
0answers
107 views

Write a FAST word equation solver [duplicate]

This is about writing a program to solve a puzzle fast. It's similar to a question asked 27 days ago, Write a word equation solver by David Frank, but this time it's about speed. My solutions finds ...
7
votes
1answer
112 views

Draw a Permutation Path

Imagine the following diagrams as sets of vertical criss-crossing tubes. 1 2 1 2 1 2 3 4 \ / \ / \ / \ / X | | | / \ / \ / \ / \ 2 1 1 2 | X | \ ...
-4
votes
4answers
136 views

The Golf (re)Sort [on hold]

The Golf (re)Sort Everyone is sorting arrays these days, and so do we at our day jobs. But we like to go out golfing. When we do, we sure like to take our time. It is important to have a stress ...
2
votes
0answers
139 views

StackExchange Mustafa can't stand to be asked the same question three times

Austin: "Who sent you?" Mustafa: "You have to kill me!" Austin: "Who sent you?" Mustafa: "Kiss my ass, Powers!" Austin: "Who sent you?" Mustafa: "Dr. Evil." (...) ...
7
votes
0answers
196 views

Calculate to how many cubes one cube can be cut

Imagine some cube which we can cut into smaller cubes without remaining pieces. Find to how many cubes a cube can be cut. For example, a cube can be cut into 8, 27 (obviously 3rd powers of integers) ...
18
votes
5answers
1k views

Make a circle illusion animation

Your job is to animate this circle illusion. It looks like the points rotating inside of the circle, but they are actually just moving in straight lines. Criterias The result has to be animated. ...
-5
votes
0answers
64 views

Make a line editor [on hold]

A line editor is a type of text editor in which you edit a file one line at a time. If you've used ed you know what this is. This line editor prompts* for a command, which is then run. Your job is ...
6
votes
0answers
153 views

Golfing for Domino Day

Given a setup of dominoes your task is to figure out which dominoes fall and which don't. Input Take a rectangular ASCII representation of a domino setup. The following characters are used for the ...
1
vote
7answers
345 views

Break out of a loop [duplicate]

Now that we have over a hundred ways to get stuck in a loop, the next challenge is to get out. Specifically, write a piece of code with a (seemingly) infinite loop, but somehow manage to break out. ...
11
votes
1answer
298 views

Make me a window manager!

I hate code bloat! So I have decided to replace my Windows 7 system by a golfed version. However, I know that it is not easy, so let's build a prototype first. It will take a list of windows from the ...
11
votes
8answers
2k views

Write program which verifies Erdős–Straus conjecture

Write program, which verifies Erdős–Straus conjecture. Program should take as input one integern (3 <= n <= 1 000 000) and print triple of integers satisfying identity 4/n = 1/x + 1/y + 1/z, 0 ...
20
votes
3answers
1k views

Draw the Hilbert curve using slashes

The Hilbert curve is a space filling fractal that can be represented as a Lindenmayer system with successive generations that look like this: Thanks to ...
11
votes
3answers
245 views

Slime: The Territory War

You are a glob of slime. Naturally, being slime, you want to ooze over as much area as possible. But there are 3 other slimes who want to do the exact same thing. Who will be the superior slime? ...
-1
votes
0answers
82 views

Traverse resultant 2d array after integer partition [on hold]

I have used the solution of integer partitioning using dynamic programming explained in this post and in this article. Following is the resultant matrix when N is equal to 6: 1 1 1 1 1 1 1 0 1 1 1 ...
19
votes
6answers
479 views

Save the last bullet for yourself

Suddenly zombies appear! OH NOES! In this king-of-the-hill challenge, you must create a bot to survive the zombie apocalypse. Or at least, hold out for as long as possible. At the start of the game, ...
0
votes
0answers
118 views

Write a pretty self-describing program [on hold]

Characters can be art. Characters can be program. Program can output characters. Characters can describe art. Therefore characters can be art that is program that outputs characters that describe ...
14
votes
2answers
522 views
+200

Where does the laser go?

Take a 2-dimensional grid and draw a number of line segments on it to represent mirrors. Now pick a point to place a theoretical laser and an angle to define the direction it's pointing. The question ...
5
votes
5answers
300 views

Permutation Numbering

The Challenge For a given set of n integers, write a program which will output its lexicographic index. The Rules The input must only be a set of unique non-negative integers separated by spaces. ...
-2
votes
0answers
54 views

Comparing two software versions [on hold]

I´m working on a mod update checker for minecraft, but there is a big problem: The modders and online database that I´m using for update checks has no standard software versions e.g.: Local: ...
9
votes
22answers
2k views

Generate me some appropriate license plates!

The scenario: You are a software designer working for a gov't-run company that designs license plates for cars and other vehicles. You've been asked to develop software that generates license ...
-2
votes
0answers
67 views

Preliminary Assignment [on hold]

A. Make a program that would count number divisible by specified divisor. It would also count a set of numbers where a number(s) with that set is divisible by specified divisor. Sample output ...
35
votes
8answers
2k views

ASCII Train Golf

Consider these seven ASCII train cars. Engine (E) __ ====== \/ | [] |========= | ) ================ O-O-O O-O-O \\ Passenger car (P) =============== | [] [] [] ...
-2
votes
0answers
100 views

Monkeys on a Typewriter [on hold]

We've all heard the story about infinite monkeys writing Shakespeare. Given an infinite number of monkeys bashing on a typewriter, and an infinite amount of time, they will eventually write the script ...
0
votes
0answers
7 views

Scheme - logical operator procedures [migrated]

I know Scheme and other Lisp dialects include logical operators such as 'and' and 'or', but, since I am currently learning Scheme, I am trying to program my own logical operators. So, for my attempts ...
6
votes
9answers
692 views

Calculate a rock rolling down a hill

Introduction Sisyphus was having some troubles at work lately. It seems he just never gets anything done, and he would love to find a solution to this problem. His current employment requires ...
5
votes
2answers
256 views

Courier Ception

Courier Ception The program must accept any string as input and output an pixel image that shows the input string in Courier. All the letters that contain a 'hole' (like abdegopqABDPQR etc) that is ...
18
votes
13answers
1k views

Khinchin's constant to as many decimal places as possible in 64 bytes or less

Khinchin's constant is a curious mathematical constant that, according to Wolfram MathWold, is "notoriously difficult to calculate to high precision". Here it is to 100 digits: ...
12
votes
9answers
901 views

There is water on my window

The scenario I drive along a road with my car and it begins to rain. The raindrops are falling on my window randomly and now i ask myself, where is the biggest connected wet area? The task To make ...
12
votes
10answers
991 views

Output the answer above yours

Write a program that outputs the contents of the first HTML <code>...</code> block of the answer to this question that is just above yours when the answers are sorted by votes. Output Top! ...
8
votes
1answer
484 views

Who wants to be a Kolmogorov complexity winner?

You mission today is to invent a text compressor. Task You'll write two functions: The packer is a function that accepts a string of ASCII characters (U+0000 to U+007F) and outputs a Unicode ...
-1
votes
2answers
224 views

Shortest test for primality for byte [duplicate]

Write a function which gets as input a number (0 <= n <= 255) stored in 32-bit variable and returns non-zero integer if n is prime number and 0 otherwise. Considern = 0 and n = 1 as non-primes. ...
37
votes
41answers
5k views

Rock Around the Clock

In as few Unicode characters as possible, print the following (144 characters): 1, 2, 3 o'clock, 4 o'clock rock, 5, 6, 7 o'clock, 8 o'clock rock, 9, 10, 11 o'clock, 12 o'clock rock, We're gonna rock ...
15
votes
1answer
642 views

Find a route between two Wikipedia articles

Introduction Recently, I was skyping with a bunch of friends and we got bored and had nothing to do, so we "invented" a "game" (some people in the comments pointed out that this game is playable ...
-1
votes
0answers
50 views

Attaching Class labels to sentences [closed]

Can someone please explain the concept of using datasets in text classification? Suppose i have a document and i need to carry out sentence level classification such each sentence first has a label of ...
18
votes
5answers
3k views

Shortest expression for {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}

Given list of integers {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}. For those who interested these numbers are used in weekday calculation. Weekday = (m[n] + d + y + y>>2 + y/400 - y/100) % 7;, where ...
7
votes
0answers
84 views

Checking periodic table words [duplicate]

Given a sequence of letters, write a program to construct it using symbols on the periodic table. For example, given the input bacon, the program should output: BaCoN BAcON BaCON Note that ...
6
votes
5answers
446 views

Output nth term in Catalan type sequence

Given a number, starting with 1, create new numbers (children) by taking the last digit, n, and concatenating 1 through n+1. This seems to be a much better explanation of the sequence A071159. ...
0
votes
2answers
306 views

Conway's Game of Life with smallest *set* of source characters [duplicate]

The goal of this challenge is to write a program that will simulate a single round of Conway's Game of Life on an existing grid. Input format: Input will be read from stdin. The input will consist ...
0
votes
0answers
52 views

Implement a HashMap with alphabetic order [closed]

When people want to have a sorted map, they use a TreeMap, which is the only widely known implementation of java.util.SortedMap. TreeMap uses dichotomy to search the key, so performance is reasonable ...
12
votes
2answers
570 views

ASCII Waterworks

Intro Consider a grid of the characters f A\/ such as f f f A A / \ \ / A A \/ / \/ where: f represents a faucet that pours a stream of water downward ...
1
vote
0answers
121 views

Recover a bzip2 file

The popular .bz2 compression format is used to store all sorts of things. One of the more interesting features is that it consists of several independently decompressible blocks, allowing recovery of ...
3
votes
4answers
387 views

Difference of expressions when evaluated in different orders

We all know the standard order of operations for math functions (PEMDAS), but what if we instead evaluated expressions left-to-right? The Challenge Given a string through standard input or through ...
7
votes
5answers
466 views

Spiral in the grid

Write a program which enumerates points on a regular grid in the form of a spiral. The output should be the indices of the points (row-major) and the spiral should start at 0 and proceed ...
10
votes
2answers
425 views

Maximum number of PEP8 violations in a single line

Your task is to write a file which contains a line with many pep8 violations. The rules: We use pep8 version 1.5.7 and the default settings. Calling pep8 with other command line options or ...
-1
votes
1answer
96 views

Interleave array items in-place [closed]

When doing audio processing, it makes sense to process one channel at a time. However, audio output usually requires interleaved data (left, right, left, right, etc). Interleaving the data with ...
1
vote
10answers
753 views

Implement `map()`…with bugs

EDIT: The behavior may be inconsistent. Also, associative arrays are permitted. Make a function that iterates through an indexed array, mapping a function of a single argument to each member of the ...
17
votes
5answers
775 views

Check if three letters can form a “Godel-Escher-Bach cube”

This question is inspired by the cover of the book "Godel, Escher, Bach": The challenge here is to write a function that tells if three given letters can produce a 3D sculpture that can be read ...

15 30 50 per page