3
votes
0answers
36 views

Graph Google Search Results

When you search for something on Google, it conveniently gives a message near the top of the page saying something like About 53,000,000 results (0.22 seconds). (The numbers change depending on what ...
3
votes
0answers
36 views

Golfscript Diagonal Array

Is there a way in Golfscript to bring all of the diagonals of an array into a single array? For example, for the array [[1 2 3][4 5 6][7 8 9]] return [[7][4 8][1 5 9][2 6][3]] (not necessarily ...
-1
votes
0answers
36 views

Pick the Numbers from the Sequence such that resulting sum after some operations is maximum? [on hold]

You are given a sequence of numbers a1,a2,a3, upto an. Now you have to do operations on them that is take any two numbers //taking s=0; s=s+(a1*a2) d=(a1*a2)%199 resulting d now can chose any ...
16
votes
6answers
470 views

Word Search Puzzle

Given a rectangular text as a word search puzzle and a search string, determine if the text contains the search string. The search string may appear: horizontally, vertically or diagonally forwards ...
1
vote
2answers
162 views

Find the next number in the pattern

Write a program, that takes 5 numbers as input and outputs the next number in the pattern. Heres a text file with 1835 test patterns, containing 6 numbers separated by commas each line. Using the ...
10
votes
6answers
575 views

Draw a range of mountain ranges

Inspired by Fibonacci domino tiling, this problem is about generating ASCII art representing another famous combinatorial sequence. A n-step mountain diagram is a drawing of a mountain range, using ...
7
votes
0answers
239 views

Underhanded Bank Account

You are working as a programmer for a bank. Your task is to write a program that handles the transactions from one bank account to another. The program should do the following: Run in an infinite ...
4
votes
2answers
202 views

String Bit Manipulation- There and Back Again

Your job is to encrypt a string using a number key. Your program will receive 2 strings: one containing a sequence of characters to encrypt, and another one containing an even amount of digits (1-9, ...
7
votes
6answers
439 views

Mixed Base Conversion

Background Most people on here should be familiar with several base systems: decimal, binary, hexadecimal, octal. E.g. in the hexadecimal system, the number 1234516 would represent 1*16^4 + 2*16^3 + ...
-6
votes
0answers
63 views

Code that returns a set of decimal degrees gps coordinates [on hold]

I came across this riddle in a java programming forum, i figure that other languages can be more creative and ingenious. The code will not be used outside of self educational purposes. The resulting ...
13
votes
1answer
304 views

Minimal Boggle-like Arrangements

Consider how a word could be arranged on an arbitrarily large Boggle grid if the rule about not using the same letter cube more than once is ignored. Also assume that you have an unlimited number of ...
14
votes
7answers
1k views

Countdown and recycle

Countdown Your goal for this code-golf challenge is to count down and meanwhile recycle numbers. Let me explain. First your application reads a number, either as program argument or using stdin. ...
8
votes
8answers
940 views

Fibonacci domino tiling

There's classic combinatorial result that the number of ways to tile a 2*n strip by 1*2 dominoes is the nth Fibonacci number. You goal is to print all the tilings for a given n, drawn with dashes and ...
5
votes
3answers
561 views

Make a WaterOverflow

You and a friend are playing a game - who can overflow the most containers? There are n containers numbered 1 to n. Each container has a certain maximum capacity of water, in litres. You take turns ...
22
votes
1answer
411 views

Standardise a Phinary Number

Background Most people on here should be familiar with a few integer base systems: decimal, binary, hexadecimal, octal. E.g. in the hexadecimal system, a number abc.de16 would represent a*16^2 + ...
10
votes
1answer
457 views

Programmer's Garden

Programmer's Garden Being a professional software developer, you cannot risk exposing yourself to the harsh non-artificial light of the sun, but you also have a soft spot for flowers, and want to ...
27
votes
14answers
2k views

String.prototype.isRepeated

UPDATE : isaacg's Pyth submission is the winner! Many of you must have heard that there is a cooler version of JavaScript in town (read ES6) which has a method String.prototype.repeat so that you ...
5
votes
0answers
163 views

Which positive integer is equal to it's own Scrabble score when spelt out in full? [on hold]

The Challenge: Make the shortest program to confirm that 12 is the answer. (The puzzle is from Ian Stewart's "Cabinet of Mathematical Curiosities". This is my first code golf question. I hope this ...
25
votes
1answer
684 views

Animation of Code Golf

When I see code-golf entries that knock a few characters off, whittling down the code, I go look at the edit history for a side-by-side diff. See and learn :) This challenge is to make a program ...
3
votes
2answers
380 views

Rolling digital number lock [duplicate]

There's a simple digital number lock. After each button press the lock checks if the previous four presses constitute the correct code. I.e. typing 44445 tests two codes: 4444 and 4445. You must brute ...
6
votes
7answers
1k views

The Bowlers-Golfers Fraction War

Introduction Let's start by arranging all fractions from 0 to 1 in order of lowest denominator, then lowest numerator: 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7... Note that ...
9
votes
4answers
387 views

How NOT to reduce fractions

Reducing fractions the wrong way In this code-golf challenge you have to find fractions that can be reduced the wrong way but still end up in the same number. Note: reducing fractions the worng way ...
22
votes
20answers
5k views

Crack the code to the combination lock

Given a standard combination lock like the one in the picture. The way to unlock it is to align the 4 numbers in the code on the combination line. After years of loyal service you have been fired from ...
4
votes
1answer
247 views

Unnecessary Text Abbreviations

Introduction I can't stand text abbreviations, mainly because for the most part I have no idea what most of them mean. Of course, cut backs need to be made, so if they are necessary to fit the text ...
9
votes
3answers
414 views

Sort some apples!

Problem Imagine 7 buckets lined up in a row. Each bucket can contain at most 2 apples. There are 13 apples labeled 1 through 13. They are distributed among the 7 buckets. For example, {5,4}, {8,10}, ...
23
votes
5answers
2k views

Radioactive Quines

A radioactive quine is a quine-like program that has an even number of characters and, when run, outputs itself with exactly half of its characters removed. The output itself may be a radioactive ...
9
votes
1answer
361 views

Reorganize By Arrows

Lets say I was writing something, and I accidentally wrote it in the wrong box: +-------+--------+ | Verbs | Nouns | +-------+--------+ | Truck | | | eat | Banana | | | Car | ...
6
votes
0answers
207 views

Detect Duplicate Questions

Detect Duplicate Questions Once upon a time, there was a golfing site. It had a problem: people would post similar or identical questions again and again. You have been chosen selected forced ...
7
votes
6answers
659 views

Curve Stitching

Curve stitching is the process of "stitching" together multiple straight lines in order to create a curve, like so: For an explanation of curve stitching, visit this website. We will be drawing ...
11
votes
4answers
471 views

Find the Chromatic Number

Surprisingly, we haven't had any challenges on graph colouring yet! Given an undirected graph, we can give each vertex a colour such that no two adjacent vertices share the same colour. The smallest ...
7
votes
4answers
329 views

Generate Eban Numbers

(Continuing on the number sequences code-golf, here is an interesting sequence) Eban Numbers (A006933) are the sequence of numbers whose names (in English) do not contain the letter "e" (i.e., "e" is ...
1
vote
0answers
101 views

Write the shortest one-statement python quine [duplicate]

I wrote this one-line one-statement Python quine a little while back. print (lambda x: x + str((x,)))('print (lambda x: x + str((x,)))',) The point is, it's all one line, and one function (i.e. no ...
6
votes
4answers
803 views

Penalty Shootout

Penalty shootout Welcome to CG world cup. Your job: Code a penalty shooter and goal keeper! Rules of the game: The goal is 700 cm wide and 200 cm tall. If I have to make a rectangle out of it, ...
5
votes
12answers
464 views

Check the jumbled words [duplicate]

This is an easy one. Anagrams are words which have the same characters but in different order. All you have to do is to figure out if two strings are anagram or not. Rules: Take two strings as a ...
10
votes
2answers
342 views

Write a Clem interpreter

Clem is a minimal stack-based programming language featuring first-class functions. Your objective is to write an interpreter for the Clem language. It should properly execute all examples included in ...
8
votes
3answers
353 views

Pigpen Cipher Encryption

Pigpen Cipher Encryption Your mission is simple: to write a program which receives text as input and outputs an ASCII representation of it in the Pigpen Cipher. Input ASCII-only (no Unicode) ...
12
votes
6answers
610 views

Electron Configurations

Electron Configurations Your mission is to accept an element's atomic number as input, and output its electron configuration (e.g. 2,8,8,2 for calcium). Input An atomic number from 1 to 118. You ...
18
votes
30answers
3k views

Generating a single string with an Oxford comma from a list

What are some clever (brief and idiomatic) approaches to taking a list of strings and returning a single properly punctuated string built from the list, with each element quoted. This came up for me ...
7
votes
2answers
197 views

Drive a hexadecimal 7-segment display using NAND logic gates

The ubiquitous 7-segment numerical display can unambiguously display all 16 hexadecimal digits as show in this wikipedia .gif Entries for this challenge will create a circuit diagram using NAND logic ...
6
votes
5answers
410 views

Tips for golfing in Applescript

What tips do you have for golfing in Applescript? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Applescript (e.g. "remove comments" ...
7
votes
15answers
839 views

Generate Recamán's sequence

Recamán's sequence (A005132) is a mathematical sequence, defined as such: A(0) = 0 A(n) = A(n-1) - n if A(n-1) - n > 0 and is new, else A(n) = A(n-1) + n A pretty LaTex version of the above ...
4
votes
1answer
150 views

Arranging Fenceposts

If you want to build a fence and have different length boards available, there are many different ways to set up your posts. So, given a minimum and maximum board length, a number of boards, and the ...
11
votes
5answers
301 views

False Positives on an Integer Lattice

Leaderboard User Language Score ========================================= feersum C++11 100,993,667 Ell C++11 78,824,732 Geobits Java ...
11
votes
3answers
161 views

Tips for Golfing in ECMAScript 6

This is similar to other "Tips for golfing in <...>" but specifically targeting the ECMAScript 6 features in JavaScript. JavaScript inherently is a very verbose language, function(){}, .forEach(), ...
7
votes
2answers
613 views
+50

Restricted memory optimization

The edit (or Levenshtein) distance between two strings is the minimal number of single character insertions, deletions and substitutions needed to transform one string into the other. If the two ...
6
votes
3answers
287 views

Catenary Between Two Points (Hanging Chain)

This is one of several challenges left for the community by Calvin's Hobbies. The curve that an idealised hanging rope or chain makes is a catenary. Image by Bin im Garten, via Wikimedia Commons. ...
-6
votes
2answers
180 views

Challenge: Crack the code

I have created a simple encryption algorithm. Your challenge, if you choose to accept it, is to re-produce the algorithm that encodes one string into it's encoded counterpart and then back again by ...
2
votes
0answers
85 views

Tips for golfing in OCaml

Inspired from the assortment of other 'Tips for golfing in language xyz'. As usual, please only suggest tips that are specific to OCaml and not programming in general. One tip per answer please.
28
votes
19answers
4k views

Easily Typeable Words

This competition is over. The winner is CJam with 22 characters, beating TwiNight's answer by one character. Congratulations Dennis! An honorable mention goes to Falko, who went totally crazy with ...
12
votes
6answers
920 views

Integer Emotions

Write a program or function that "reacts" to a given integer n (input via function parameter/args/stdin) The program doesn't care about negative numbers, likes even, dislikes odd numbers and ...

15 30 50 per page