0
votes
0answers
39 views

Circular Quines [duplicate]

A quine is a program that, when run, produces the same output as the program itself. In other words, it is a self-replicating program. We will define a circular quine as follows: given a program A in ...
8
votes
7answers
320 views

Undo the square roots

Your job is to convert decimals back into the sum of the square roots of integers. The result has to have an accuracy of at least 6 significant decimal digits. Input: A number indicating the number ...
14
votes
24answers
1k views

Is a number divisible by each of its digits?

My friend and I were working on a lab in our AP Computer Science class and decided to code golf one one the problems since we still had half the class free after we finished. Here is the question: ...
19
votes
5answers
730 views

Numbers as Circular Graphics

First, study this puzzle to get a feel for what you will be producing. Your challenge is to write a program or function which will output a circular graphic like the ones from the puzzle, given a ...
-1
votes
0answers
70 views

Unholy HTML parsing [duplicate]

Inspired by this classic, Your goal is to write a program that will output this exactly: You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can ...
1
vote
1answer
119 views

Challenge Ulamspiral [duplicate]

The challenge Get familiar with the Ulam spiral: The aim is to print the spiral like in the picture above! Rules Write a function ulam(n) where n is a odd positive integer and describes the size ...
1
vote
1answer
101 views

Shortest Code to Translate a PHP array

NOTE: This question was migrated from http://stackoverflow.com/q/27134588/1442685 PHP QUESTION Almost purely out of curiousity, how can I take an array like this: array( 'fruit' => 'banana', ...
0
votes
0answers
50 views

Game in C programming [on hold]

I have to do a little game in C, it is about a wolf who needs to chase some sheeps who are distributed in a little map, and also he can take some objects distributed along the map... The game will be ...
1
vote
0answers
35 views

Solving Des Chiffres Et Des Lettres - The total is right [duplicate]

One of the games of the French TV show Des chiffres et des lettres, called Le compte est bon ('The total is right'), consists of the following : You get a number A between 101 and 999 as well as six ...
6
votes
0answers
45 views

Tips for Golfing in Go

What general tips do you have for golfing in Go? I'm new to Code Golfing and looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Go. Idea ...
8
votes
4answers
348 views

12 Days of Golfmas

Challenge On each of the 12 days of Christmas, output the appropriate verse of "12 days of Christmas", according to the date, otherwise output the chorus of "I Wish It Could Be Christmas Everyday". ...
1
vote
0answers
68 views

0h h1: Logical optimization [on hold]

I've written a recursive backtracking solver for the game 0h h1. It's a simple game that takes place on a square grid, and each cell can be empty, red, or blue. You are given an initial configuration, ...
10
votes
18answers
2k views

Sum of strings without converting

You have to take 2 string inputs and output the sum of these two strings without converting them to int or using any numeric data type. ex. string one = "123"; string two = "456"; string sum = ...
1
vote
0answers
48 views

Automate xmpp requests to ESL website to challenge opponents [on hold]

ESL gaming, where you can challenge players to play games. I've provided some steps you can take manually to challenge a player. Note that you have to signup for an account and have to be logged in to ...
4
votes
4answers
465 views

Shortest program to split special array

Background Imagine, you have a big array A, which is mostly zeroes, but contains a short subarray B which has only strictly positive entries. For instance: | A | [0 0 0 ...
-1
votes
0answers
78 views

Python Locker Puzzle [on hold]

A school has 100 lockers and 100 students. All lockers are closed on the first day of school. As the students enter, the first student, denoted S1, opens every locker. Then the second student, S2, ...
0
votes
0answers
89 views

Container wars! [on hold]

There's a simple problem: suppose we have a list of items, and a container to fill. The maximum weight of the container is 1000 units and the volume of the container is 1000 units. The goal is to have ...
5
votes
3answers
251 views

Looking for shorter alternatives to `range(…)`

The best solution I've found so far for a golf code puzzle I'm working on includes two rather fat-looking invocations of range. I'm very new at code golf, especially in Python, so I could use a few ...
0
votes
0answers
54 views

Sorted, shifted binary sequence [on hold]

Consider a sequence b1b2 . . . bN of N binary digits. Given such a sequence, we rotate it by one digit to the left N−1 times to generate a block of N sequences arranged in an N × N array of 0’s and ...
1
vote
7answers
746 views

Wait, but what's e^N?

Objective: The objective is to calculate e^N for some real or imaginary N (e.g. 2, -3i, 0.7, 2.5i, but not 3+2i). This is code golf, so, shortest code (in bytes) wins. So, for example: N = 3, e^N ...
8
votes
5answers
505 views

Smallest Bytecode Interpreter/VM

Leaderboard - JIT Compiled (Lower is better) es1024 - 81.2 points (including a working compiler!) Kieth Randall - 116 points Ell - 121 points Leaderboard - Interpreted (Lower is ...
-4
votes
2answers
84 views

Magical Squares [on hold]

A perfect square is a number that is the square of an integer. However, let's define something called a Magical Square, which is a perfect square with the following restriction: The perfect square ...
8
votes
5answers
233 views

Generalized Gematria Calculator

Create a bidirectional Gematria calculator, for any given sequence of Unicode characters as the alphabet. Gematri-What? Gematria is a system of assigning numerical values to symbols, developed by ...
7
votes
1answer
170 views

Cyclically Equivalent Words

Cyclic Equivalence Let L be a list of pairs of letters, for example [(a,b), (a,c)]. We call L a list of commutators. Two words are cyclically equivalent over L, if one can be transformed into the ...
-6
votes
0answers
38 views

prime numbers in pythion [on hold]

in this link: Find the Nth pair of twin primes you had answered and wrote a programm in python for that (the question was to find the nth pair of twin primes ) the problem is with a big index number ...
11
votes
7answers
469 views

Balanced Ternary Converter

Credits for the challenge idea go to @AndrewPiliser. His original proposal in the sandbox was abandoned and since he has not been active here for several months, I have taken over the challenge. ...
-2
votes
1answer
90 views

Algorithm for finding a regex for a list of “words” [on hold]

I just discovered this website and was amazed. Somehow this challenge popped into my mind: Provided a very long list of words; Write or describe an algorithm which finds a regex to match them all. ...
11
votes
24answers
3k views

Find i^n, given n

The Challenge In as few characters as possible, find the value of i^n, given n, a positive integer greater than 0. This should be outputted as a String. For those that don't know, i is defined such ...
25
votes
12answers
3k views

Say Hello to the Pioneers of Computer Science

Choose your favorite famous computer scientist or computer science pioneer who was born in 1942 or earlier (as 1943 marks the start of the creation of the 'first' computer). They should have a ...
6
votes
6answers
411 views

Short drawing programme

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 ...
7
votes
1answer
211 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
160 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 ...
0
votes
1answer
70 views

CSS attribute selector efficient “greater than selector” code [closed]

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) { ...
20
votes
6answers
2k 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
119 views

Find a six-digit number containing: [closed]

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
154 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 ...
47
votes
24answers
10k 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
179 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
579 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 ...
10
votes
3answers
388 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
241 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
115 views

Help Potatoes make the best Coding French Fries [closed]

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 ...
7
votes
1answer
297 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
421 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 ...
13
votes
9answers
777 views

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 ...
37
votes
40answers
4k views

A Different Kind of Meta Regex Golf

Notice: Following popular demand I have slightly relaxed the rules: The maximum regex size grows by 1 byte every 5 answers. Answer N may use up to 29 + ⌈N/5⌉ bytes. The score of each ...

15 30 50 per page