-5
votes
0answers
32 views

Generating a code from package name of android apps [on hold]

Consider an application which generates a long code from package name of Android applications. For example: Package name | Code ----------------------------------------------- ...
6
votes
2answers
149 views

3x3 Connected Components

The Challenge Consider the 3x3 king grid, as shown in the following ASCII graphic: A--B--C |\/|\/| |/\|/\| D--E--F |\/|\/| |/\|/\| G--H--I You are given as input a length-9 list of integers that ...
10
votes
11answers
487 views

Shorter than a Split Second!

Challenge You task for this question is to split an input array of integers on the second occurrence of every integer in that array. Not clear enough ? Here is an example to help Input array: [2 1 ...
12
votes
28answers
775 views

Create an array with repeated numbers

Challenge Your task in this question is to write a program or a named function which takes a positive integer n (greater than 0) as input via STDIN, ARGV or function arguments and outputs an array ...
10
votes
16answers
1k views

Most common number

Calculate the most common number in a list. You should use an expression that fits on one line (the record is just 18 characters). d = [4,3,1,0,6,1,6,4,4,0,3,1,7,7,3,4,1,1,2,8] winner = ... # TODO: ...
9
votes
1answer
371 views

Sharing pizza fairly

The difficulty with sharing pizza with friends is that it is hard to make sure that everyone gets the same amount of pepperoni on their slice. So, your task is to decide how to fairly slice a pizza so ...
8
votes
3answers
301 views

Write a Magic Spellchecker

The game Waving Hands is somewhere between a pen-and-paper Magic: the Gathering and a very elaborate Rock Paper Scissors. Each turn you write down one of eight gestures for each hand: wiggled ...
30
votes
8answers
1k views

Reverse indentation

I've heard that your code can run faster if you indent it in reverse, so that the compiler can process it like a tree design pattern from the very top of the "branches" down. This helps because ...
2
votes
0answers
297 views

Draw A Snowflake

Joe lives at the Bahamas. It is winter. His children are disappointed that there is no snow. Joe needs to make snow for his children. Fortunately, he has a 3-d printer. He plans to make snowflakes ...
-5
votes
0answers
43 views

Write a computer program in C++ that lists all selections of size, m from the objects, n where n > m [on hold]

Input: A, B, C (user’s choice. It can be more than 3 symbols. In this case, n = 3) m = 2 (user can select any number for m, but remember n >m) Output: AB, BC, AC
5
votes
5answers
394 views

Create a T9 keyboard [on hold]

This question asks for a T9 dictionary matching functionality which is a very interesting problem. But T9 has another way of typing and that is typing character-by-character. You would NOT need a ...
-1
votes
3answers
177 views

Meta-atomic code golf

In this meta-challenge, you will score your own atomic-code-golf submissions. More precisely, you will need to write a program P in language L such that the atomic-score of P is produced by P. Score ...
28
votes
40answers
8k views

yes is 91 lines long

yes, from coreutils, is 91 lines long. Many of them are comments, but that is still WAY too long. Write a program that imitates yes: outputting to stdout an infinite stream of "y\n"'s there must be ...
17
votes
5answers
951 views

Caesar-Cypher-Mania

The Caesar Cypher is a very simple substitution cypher where each letter is shifted by a fixed offset (looping around Z to A). Similarly, we can also a Caesar cypher for the set of printable ASCII ...
7
votes
2answers
533 views

Draw Sri Yantra

Challenge: Draw Sri Yantra. How to: There are different ways to draw it. All include many steps. If you think you can draw it without following the linked steps scroll below for the elements you ...
14
votes
10answers
1k views

Find the last Sunday in every month of a given year

F# solutions known inside 140 chars, and this is a Rosetta Code problem. Required result on stdout or in a string variable for input year 2014: 2014-01-26 2014-02-23 2014-03-30 2014-04-27 ...
17
votes
3answers
367 views

Squarefinder – Locating regular tetragons

Imagine a bunch of rectangles drawn in the plane, each rectangle with its vertices at integer coordinates and its sides parallel to the axes: The rectangles partition the plane into a number of ...
47
votes
9answers
3k views

Draw the Warm Welcome Secret Hat

Winter Bash 2014 is on its prime and don't we all love the hats ? Especially the secret hats! So why not draw one of secret hats ? The challenge Your task is to draw the Warm Welcome Hat in ...
19
votes
6answers
1k views

Confuse the Dakotas

You have been hired by the government of North Dakota to encrypt the state's communications. Write two programs, one to encrypt a message and one to decrypt that message. The government is not really ...
-7
votes
0answers
103 views

Recursion of anonymous function in JavaScript [closed]

//sum of number console.log((/* write your code here */)(n)); Executing the above code should return sum of n (any number). e.g. passing 5 (in place of n) should print 15 i.e. (5 + 4 + 3 + 2+ 1) ...
-7
votes
20answers
311 views

Produce the word 'codegolf' without using any of its characters in code

You need to produce the word codegolf Rules: None of the characters of the word codegolf (i.e. 'c', 'o', 'd', 'e', 'g', 'o', 'l' and 'f') in either case can exist anywhere in the code. Case of ...
22
votes
2answers
332 views

Implement a PCG

What better problem for PCG.SE than to implement PCG, A Better Random Number Generator? This new paper claims to present a fast, hard-to-predict, small, statistically optimal random number generator. ...
29
votes
10answers
1k views

Verify a Minesweeper board

Your goal is to check whether a completed Minesweeper board is valid. This means that each number is a correct count of mines in cells adjacent to it, including diagonals. The board does not wrap ...
8
votes
7answers
439 views

Find pairs of numbers with a particular LCM and GCD

I was working on a math question with a friend of mine, and we decided to write a script that finds the answer. The original question is as follows: The difference of two natural numbers is 2010 ...
18
votes
9answers
810 views

Sum the time durations

Challenge Write the shortest code that can sum all the time durations that appear in the stdin. The program must only consider the strings that match with one of the following patterns and ignore the ...
11
votes
3answers
1k views

Computer: you do the math

This challenge is partly an algorithms challenge, involves some math and is partly simply a fastest code challenge. For some positive integer n, consider a uniformly random string of 1s and 0s of ...
13
votes
5answers
676 views

Return the clock emoji closest to the current time when run

I can have a large if/else condition for each 30 minutes but I'm looking for more math and Unicode based solution. Here are clock emojis: 🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧. If you lack ...
5
votes
6answers
448 views

Tic Tac Toe encoder/decoder

James Bond is about to start a new mission and you are his computer scientist friend. As Tic Tac Toe is becoming more and more popular you decide that nothing would be more underhanded than a Tic Tac ...
9
votes
3answers
691 views

“Atomic” code golf - determine the number of neutrons in an isotope

Your task is to take an string containing an isotope of an element as input, encoded like the following example with the atomic number followed by a space and the IUPAC chemical symbol for the ...
2
votes
1answer
151 views

Make a working digital clock with ascii numbers [duplicate]

The challenge is make a digital clock that exhibits ascii numbers in a 24-hour format like: _ _ _ _ |_| |_| . |_| |_| |_| |_| . |_| |_| or _ _ _ _| _| . |_| |_ |_ _| . ...
40
votes
19answers
4k views

Significant Whitespace

We define whitespace to be any of the three characters, tab (0x09), newline (0x0A) or space (0x20). For this challenge, you're to write two programs or functions in the same programming language, ...
6
votes
2answers
199 views

Find a point's position on the integral Hilbert curve

The Hilbert curves are a class of space-filling fractal curves where every bend in the path is at a right angle and the curve as a whole fills up a square, with the property that sequences of ...
59
votes
5answers
4k views

Recognise Stack Exchange Sites by Their Icon

After spending a while on Stack Exchange, I can recognise most sites in the Hot Network Questions by their little icon (which is also their favicon), but certainly not all of them. Let's write a ...
4
votes
2answers
655 views

Coding a recursive function for highest possible input

Challenge You are given the following function:- which is the same as:- with the base cases q(r, b, L) = 1 whenever r ≤ L, q(r, 0, L) = 0, if r > L and q(r, 0, L) = 1, if r ≤ L. Your task is to ...
6
votes
5answers
567 views

Implement t9-like functionality

Your challenge today is to implement a t9-like functionality. You will implement a function that will only have 2 parameters. You will receive 1 phone number in a string and the content of a text ...
29
votes
4answers
2k views

Paint by Numbers

You're given a true colour image. Your task is to generate a version of this image, which looks like it was painted using paint-by-numbers (the children's activity, not nonograms). Along with the ...
21
votes
3answers
927 views

Program a Racing Car

Your task is to write a small program that can drive a racing car fast. NEW Simple Track. Rules Your program will read in an image of the track. You can start your car on any yellow pixel, and you ...
14
votes
3answers
1k views

Distinguish between Masculine and Feminine Nouns in French within 100 characters

You are to write a very small program within 100 characters. Your program must distinguish between masculine and feminine french nouns. The output should be un if it is masculine and une if it is ...
22
votes
2answers
362 views

Partial Ordering of Regex Patterns

For the purpose of this challenge, we say that a regex pattern matches a string if the entire string is matched by the pattern, not just a substring. Given two regex patterns A and B, we say that A ...
7
votes
2answers
558 views

Divide food to the poor equally!

The problem Through a terrible procastination accident you are reborn as Scrooge McDuck for a day. To make the most out of the situation you decide to give away food to the poor. Since you also are a ...
11
votes
7answers
1k views

Longest reverse palindromic DNA substring

As you may know, in DNA there are four bases — adenine (A), cytosine (C), guanine (G) and thymine (T). Typically A bonds with T and C bonds with G, forming the "rungs" of the DNA double helix ...
17
votes
2answers
304 views

Forming Polyominoes with a Chain of Rods

Background Consider a (closed) chain of rods, each of which has integer length. How many distinct hole-free polyominoes can you form with a given chain? Or in other words, how many different ...
2
votes
4answers
396 views

Use threes to count the threes!

Write a program or function that takes two numbers - x>3 and n>0 - as input, and finds all possible bases b where the digit 3 appears at least n times in (x in base b). Input and output may be ...
6
votes
4answers
325 views

Algorithm - Costliest Possible Route in Grid Puzzle

Objective Find the most expensive path from the top-left of a square grid to the bottom-right such that its total cost is below a given threshold. Scenario You are given a square NxN grid. You are ...
18
votes
4answers
2k views

Convert numbers to binary… but you're allowed to use twos as well

Based on the "binary, but with twos" notation mentioned in this numberphile video, write a function that takes a single number as input and outputs all variations of that number in a "binary" system ...
22
votes
5answers
737 views

Create icy avatar images for the winter season

It's winter, and the time of year has come for it to start getting cold (and for strange colorful headcloths to start appearing... soon). Let's write some code to make avatar pictures and other ...
4
votes
2answers
236 views

Compute the shortest decimal representation of a IEEE 754 double-precision binary floating-point number

Format The format is a 64 bit value x representing a IEEE-754 double-precision binary floating-point number (a.k.a "a double"). x is assumed to represent a real number (not a NaN or Infinity). Goal ...
-4
votes
0answers
44 views

Shortest Java Prime Numbers programme [duplicate]

Your job is to write a Prime Numbers programme, which prints out a certain amount of prime numbers in Java. Rules: You may not look online Have fun! Smallest programme in Java(bytes, determined ...
20
votes
6answers
1k views

Mutual Negative Quines

This was inspired by Print a Negative of your Code and Golf a mutual quine. Consider a rectangle of characters, that meet the following restrictions: Consists solely of printable ASCII characters ...
14
votes
13answers
2k views

Find the Semordnilaps

Semordnilaps (also known as heteropalindromes, semi-palindromes, half-palindromes, reversgrams, mynoretehs, reversible anagrams, word reversals, or anadromes) are words which are also words when ...

15 30 50 per page