All Questions

0
votes
0answers
4 views

Say Hello to the Masters

Choose your favorite famous computer scientist or computer science pioneer who was born in 1935 or earlier. They should have a Wikipedia page or other site that lists their birth year and tells how ...
-1
votes
0answers
63 views

Build a small, but complex mobile! [on hold]

I want you to create a program that can build a mobile that can balance every weight! It should have a of max. 4 structure on every bar! (another bar counts as structure) Every value on the right side ...
0
votes
0answers
45 views

Short drawing programme [on hold]

You just invited a liberal arts major to your house and you're telling him/her "You know, I am a great programmer and I can do x and y and z..." He/she quickly gets bored and asks you: "If ...
-5
votes
0answers
60 views

Water-Bucket challenge [duplicate]

Heyho guys, Can you guys solve this problem by doing exactly what I say ? I have a 8L bucket full of water and 2 empty buckets one with 5L and one 3L. We want to split the water equally, so 4L and ...
7
votes
1answer
143 views

Complete a Tournament Bracket

Your task is to create a program which outputs a completed tournament bracket given a list of entrants, their seeds, and their scores in each game; in the fewest characters possible. Input Your ...
2
votes
0answers
125 views

Bag of words and bag of letters

Challenge You have a bag of words, and a bag of letters. Return a list of all words that can be created from any combination of letters. However, once you created a word the letters that it uses are ...
1
vote
1answer
56 views

CSS attribute selector efficient “greater than selector” code [on hold]

The goal is to find a way better than the current best known way of encoding the index of a child HTML element, so that encoded indices have the following property. if (index_i >= index_p) { ...
18
votes
4answers
1k views

Find the largest fragile prime

Consider the function Remove(n, startIndex, count) that removes count digits from the number n starting from the digit at position startIndex. Examples: Remove(1234, 1, 1) = 234 Remove(123456, 2, 3) ...
0
votes
2answers
104 views

Find a six-digit number containing: [on hold]

Find a six-digit number Find a six-digit number containing no zeros and no repeated digits in which the third digit is one more than the fourth digit, the sixth digit is one less than the first ...
4
votes
0answers
128 views

Compute the specificity of a CSS selector

Today, your task is to write a program (or a function) that accepts a string and outputs (or returns) four integers. Input The input string is a CSS3 selector, and can contain basically any ...
34
votes
20answers
5k views

418: I'm a teapot

As we all should know, there's a HTTP status code 418: I'm a teapot. Your mission, should you choose to accept it, is to use your creativitea and write the smallest possible server that responds with ...
11
votes
7answers
2k views

Reverse the Polarity

The aim of this challenge is to write a program that satisfies the following conditions: The program is not palindromic, or essentially palindromic (meaning that it is possible to remove characters ...
-3
votes
1answer
162 views

Throwing uncatchable ExecutionEngineException

The shortest C# code that generates an uncatchable ExecutionEngineException wins. You are not allowed to call FailFast directly or indirectly.
23
votes
7answers
3k views

Golf Practice: Python

This is a challenge of practicing golf optimization in Python -- reusable tricks and shortcuts to shave off a few characters. Many will be familiar to Python golfers and use common ideas from the ...
15
votes
1answer
405 views
+200

Optimum Letter Cards for Spelling Words

Let's say you have a list of words and you want to be able to use letter cards to spell each word. For example, to spell cat, you would use three cards labelled C, A, T. Assuming each card is ...
9
votes
3answers
342 views

Print the intersection of sequences

Sequences You are given four number sequences, numbered 1 through 4. OEIS The location of 0's when the natural numbers are listed in binary. Here's an example of how to calculate the sequence: ...
8
votes
3answers
232 views

“Snail” number sequence lookup

You are given integers N and M, 1 <= N,M <= 10^6 and indexes i and j. Your job is to find the integer at position [i][j]. The sequence looks like this (for N=M=5, i=1, j=3 the result is 23): 1 ...
-6
votes
1answer
106 views

Help Potatoes make the best Coding French Fries [on hold]

Will your potato make the best coding french fry? You will take input such as '10'. The input is grams of salt. The best tasting coding french fries have 20 grams of salt. Your output will be how good ...
21
votes
13answers
2k views

DVI Connector Pins

This is supposed to be a code golf challenge on the simpler end of the spectrum. But I figured it could be nice to bring out some micro-optimisation here. There are three basic types of DVI ...
-5
votes
0answers
82 views

Processing images with code [closed]

I know this is extremely general, but I think it could lead to some very cool results. One example I have lying around is using every color once in an image in a way that resembles it, for instance ...
7
votes
1answer
280 views

Digesting Polygons

Digesting a polygon is a process in which you take an input polygon, and create another polygon that can contain the entirety of the input polygon, while having one side less than it. The goal of ...
27
votes
13answers
3k views

Sudoku Compression

Your job is to write a program (or two separate programs) in any language that: Can take a completed Sudoku board as input (in any logical format) and compress it into a string of characters Can ...
16
votes
4answers
389 views

Write a C / C++ Polygot

This challenge's concept is pretty simple. All you have to do is write a program that will compile as both valid C and valid C++! Well, there are some catches. The program must behave differently when ...
11
votes
6answers
595 views
+100

Treasure Hunting on a Deserted Island

Introduction You are stranded on a deserted island with some servants and are hunting for treasure. The longer one searches, the more treasure one finds. The fewer people searching, the more each ...
38
votes
30answers
3k views
+100

A Different Kind of Meta Regex Golf

In regex golf, you're given two sets of strings, and are asked to create the shortest regex which matches all strings in the first set, but fails on all strings in the second set. That is what we're ...
10
votes
4answers
567 views
+100

Tiling, given vertex configuration

Task The task is to tile polygons, given a vertex configuration. Scoring Your score is equal to the "complexity level" your submission reaches. Complexity levels are cumulative, meaning that to ...
9
votes
6answers
799 views

Michael Crichton's Mousetrap

In 1984, Michael Crichton wrote a security program in BASIC that was published in Creative Computing magazine. The program would ask the user to type a phrase of her choice, record the intervals ...
16
votes
6answers
731 views

Predict the Falling Rocks

In this challenge, you are given a map of a two-dimensional terrain, viewed from the side. Unfortunately, some parts of the terrain are floating in the air, which means they'll come crashing down. ...
44
votes
6answers
4k views

Let's Judge Some Books By Their Covers

Everyone knows that the content makes the question. But a good title helps too, and that's the first thing we see. It's time to turn that first impression into a program, and figure out what kinds of ...
9
votes
2answers
238 views

Generalized Quine Generator

The Challenge In this challenge, you specify a source language S and a target language T. Your task is to write the following program P in the language S. If a valid program Q in the language T is ...
8
votes
5answers
820 views

Calculate the Delacorte Number of a square

Challenge: implement calculation of a Delacorte Number in any language. Shortest code wins. For a given square matrix of distinct integers 1..n² (possible side length n at least between 3 and 27), ...
1
vote
0answers
223 views

Implement multiplication without using any loops, branches or function calls [closed]

I came up with the following in GNU C r=0;m(a,b){x:goto*(int*[]){&&x,&&y}[r+=a&1?0:b,a>>=1,b<<=1,a<1];y:;} One could argue there is a branch here a&1?0:b So ...
-2
votes
0answers
21 views

Power shell script to convert csv to excel with out installing excel services [migrated]

I have written the power shell script to export the view in to a CSV file. But I want the same data to be exported to EXCel. I don't have excel installed on my share point server and my client does ...
5
votes
0answers
195 views

Tic-Tac-Toe and Chess, with fewest [distinct] characteers

In this form of the game Tic-Tac-Chec, the goal is to move chess pieces to get four-in-a-row. Your goal here is to figure out if a position has a winning move. Rules The rules are similar, but not ...
19
votes
4answers
1k views

The Fatal Error Challenge

Objective Write a routine that accepts a string of printable ASCII characters, s, and returns a string containing the same characters as s, reordered so that no two-character substring appears more ...
4
votes
1answer
266 views

Evaluate CDF of Student-t distribution

The goal of this codegolf is evaluating the cumulative distribution function of the student-t probability distribution. This is not trivial since there is no closed form and the function is dependent ...
-1
votes
0answers
176 views

Make Copying Easier!

Introduction Writing essays was made so much easier with the invention of Wikipedia. The thing is that you get these annoying links in your text and left behind citations[3] giving you the job of ...
8
votes
2answers
336 views

Group the Numbers With the Same Sum

Your task is, given a square grid of digits (0-9), output one of the ways that the digits can be grouped such that: Each digit is part of exactly one group All groups have the same number of digits ...
20
votes
3answers
902 views

Place a Carcassonne tile

The board game In the board game "Carcassonne" players place tiles by matching their edges and earn the highest scores through creating large contiguous areas of terrain. The following are (roughly) ...
14
votes
4answers
377 views

Decompose a number with bit-xor without the digits 0, 3, 7

Challenge Write a function or program which takes a positive decimal number, call it A, and output two positive numbers, B and C, such that: A == B bitxor C B and C must not contain any of the ...
23
votes
11answers
2k views

It's Spanish Time!

I have a simple task that should be relatively easy to implement by means of code. Your goal is to write a program that will output the time written in Spanish, given the time in HH:MM format. Many ...
-2
votes
1answer
276 views

Append element to array only if it exists?

I know that, given an array a and an element e, a.push(e) appends it. However, consider an object o and the following code: // o = {...} var a = [o.one]; a.push(o.two); Assuming o.one = 1 and o.two ...
7
votes
2answers
253 views

Calculate a pi-based sequence with a pi-based frequence

Introduction Pi is 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089... Let's treat each digit as an instruction as to how to get to the next digit. The first ...
8
votes
1answer
382 views

WinAli - Virtual CPU for understanding assembly language

WinAli is a model assembler for Windows. It emulates a real CPU and is meant to help students learning and understanding the Assembly language. German Wikipedia article: ...
37
votes
7answers
3k views

Avoiding Rivers

Background In typography, rivers are visual gaps in a block of text, which occur due to coincidental alignment of spaces. These are particularly annoying since your brain seems to pick them up more ...
9
votes
3answers
1k views

Find highest scoring matrix without property X

This challenge is partly an algorithms challenge, partly an optimization challenge and partly simply a fastest code challenge. A cyclic matrix is fully specified by its first row r. The remaining ...
10
votes
7answers
812 views

Graphical Representation of Koch Snowflake

Generate a Koch Snowflake A Koch snowflake is a triangle that for each n, another equilateral point is added in the middle of each side: http://en.wikipedia.org/wiki/Koch_snowflake#Properties We ...
32
votes
161answers
13k views

Unscramble the Source Code [robber thread for cracking attempts]

This is the companion thread to the main Unscramble the Source Code challenge. If you think you have managed to unscramble one of the cop answers, you should post your solution as the answer to this ...
95
votes
214answers
17k views

Unscramble the Source Code

In this game of cops-and-robbers, each cop will write a simple program to give a single output. They will then make public four things about their program: The language The program length The ...
2
votes
1answer
258 views

Make your own clock! [closed]

Write a program which produces a digital clock on the screen. The clock must update every second, and show time in the format 01:23:45 PM. However, you may not use the computer's built-in clock, or ...

15 30 50 per page