All Questions

-2
votes
10answers
107 views

Convert alphanumeric (base-36) sentences into hexadecimal (base-16) sentences

I use "sentence" here loosely to mean "any sequence of words separated by spaces" and "words" to mean "sequences of alphanumeric (hexatrigesimal) characters unseparated by spaces". Conversion is from ...
5
votes
9answers
183 views

Maximum summed sub sequences with no two numbers sharing the same digit [on hold]

Suppose there are 5 positive integers in an array or list as 14, 12, 23, 45, 39. 14 and 12 cannot be taken in the subset as 1 is common in both. Similarly {12, 23}, {23, 39}, {14, 45} cannot be ...
10
votes
1answer
100 views

Convert between Korean two-set keyboard and qwerty keyboard

Introdution It is somewhat like DVORAK Keyboard layout , but MUCH harder. Let's talk about Korean keyboard first. As you can see in Wikipedia, there is Kor/Eng key to change between Korean and ...
-1
votes
8answers
272 views

Point out a string character [on hold]

Introduction In many programming languages, within syntax exceptions, it is often pointed out to the programmer exactly which character or line is the culprit. This challenge will be a bit of a ...
23
votes
28answers
2k views

Construct a word ladder

Given a list of at least two words (made only of lowercase letters), construct and display an ASCII ladder of the words by alternating the direction of writing first to the right, then to the left, ...
27
votes
15answers
2k views

Count rotary dial pulses in a phone number (including letters)

In your grandparents' day, dialing a phone number was done with a rotary dial like this: To dial each digit, put your finger in the corresponding hole, pull it over to the finger stop, and release it....
-4
votes
2answers
140 views

Random Cake Bake

Warning: This is a bit lengthy I have decided to build my own random function I call it "Random Cake" This function should get an integer value between 0 and 99999 Ingredients ...
0
votes
3answers
187 views

Havel-to-da-Hakimi [duplicate]

It was a dark and stormy night. Detective Havel and Detective Hakimi arrived at the scene of the crime. Other than the detectives, there were 10 people present. They asked the first person, "out of ...
44
votes
64answers
13k views

Dad jokes are fun

We all know the classic dad joke that goes something like this: Somebody says a sentence to describe their self (e.g. I'm tired or ...
48
votes
11answers
5k views

Gravitational Force Between Numbers

The gravitational force is a force that attracts any two objects with mass. In this challenge our objects will be Numbers and their mass will be their value. To do so, we don't care about the strength ...
7
votes
1answer
142 views

Sliding retrieval

Thanks, Uncle (the story) My slightly mad uncle recently left for the space colonies, and passed his pallet goods business to me. The rectangular warehouse is full of pallets of goods except for the ...
0
votes
0answers
100 views

Minimum cost for the machine [closed]

Benjamin has N boxes in his garden with dimension xi*yi*zi each. Because he does not want to let them out and get wet, he wants to put them in the warehouse with a capacity of V. To solve this problem,...
-2
votes
1answer
518 views
+50

Output first \$n\$ digits of \$\pi^{1/\pi}\$

This challenge is to produce the shortest code for the constant \$\pi^{1/\pi}\$. Your code must output the first \$n\$ consecutive digits of \$\pi^{1/\pi}\$, where \$n\$ is given in the input. ...
18
votes
22answers
2k views

To exponential digit growth and beyond!

Challenge Given a base \$1 < b < 10\$ and an index \$t \ge 1\$, output term \$x_t\$, defined as follows: \$x_1 = 11_{10}\$ \$x_{i+1}\$ is obtained by converting \$x_i\$ to base \$b\$ and then ...
4
votes
1answer
223 views

Knights and Knaves and Codes

In this challenge, your bot has landed on an island with the stereotypical knights and knaves. Knights always tell the truth, and knaves always lie. The objective is to find the correct 32 digit ...
17
votes
6answers
2k views

Surface of the 3x3x3 cube as a graph

Your task is to generate a graph with 54 vertices, each corresponds to a facet on a Rubik's cube. There is an edge between two vertices iff the corresponding facets share a side. Rules You may ...
-4
votes
0answers
70 views

Programming challenge [closed]

We recently started a data science community within our company. To get everyone warmed up, we want to set out some sort of programming / data science coding challenge. This can for example be a ...
13
votes
32answers
2k views

Split into three!

Given a string, you've to split it into groups of three characters (by padding _ at the end). Related, but still it's different. Sample I/O: ...
23
votes
6answers
706 views

Expand a hexagon

Given an ASCII art hexagon as input, output one whose sides are all one unit longer. ...
20
votes
8answers
1k views

Warped chessboard

This challenge is about building a chessboard in which the square size, instead of being constant across the board, follows a certain non-decreasing sequence, as described below. The board is defined ...
14
votes
6answers
1k views

Save my secrets!

I have so many secrets and nowhere to keep them! The goal is simple: write a program that lets you save a string and have it be protected by a password. The program will take an alias, password and (...
30
votes
40answers
4k views

pwaS eht tirsf dna tasl setterl fo hace dorw

Or, "Swap the first and last letters of each word" Your challenge is to, given a string of alphabetical ASCII characters as well as one other character to use as a delimiter (to separate each word), ...
26
votes
11answers
4k views

Gambler's Fallacy Dice

The gambler's fallacy is a cognitive bias where we mistakenly expect things that have occurred often to be less likely to occur in the future and things that have not occurred in a while to be more ...
-3
votes
13answers
262 views

Convert a number into “bracket” numerals

"Bracket" numerals are a type of 'numerals' I made up once, and thought would be a nice challenge here. Basically, you convert the input number into base 6, and then transliterate the ...
26
votes
22answers
3k views

Parse a C++14 integer literal

According to http://en.cppreference.com/w/cpp/language/integer_literal, integer literals consist of a decimal/hex/octal/binary literal and a optional integer suffix, that is obviously completely ...
17
votes
15answers
1k views

Divisor Rich and Poor Numbers

Introduction In the strange world of integer numbers, divisors are like assets and they use to call "rich" the numbers having more divisors than their reversal, while they call "poor" the ones having ...
20
votes
16answers
3k views

​Cuban​ ​Primes

Given a natural number \$n\$, return the \$n\$-th cuban prime. Cuban Primes A cuban prime is a prime number of the form $$p = \frac{x^3-y^3}{x-y}$$ where \$y>0\$ and \$x = 1+y\$ or \$x = 2+y\$ ...
10
votes
2answers
279 views

Golf my Ada arrays

Background Ada is a programming language that is not exactly known for its terseness. However, its array literal syntax can in theory allow for fairly terse array specifications. Here is a simple ...
12
votes
5answers
277 views

Ambassadors and Translators

Two ambassadors at a UN conference want to speak to each other, but unfortunately each one only speaks one language- and they're not the same language. Fortunately, they have access to several ...
12
votes
7answers
1k views

Generate ladder of integers using the least number of unique characters (in C++)

I am new to the sport of code golf. I am trying to generate a ladder of integers using the least number of unique characters in C++. Let's say we are given an integer 4. We will generate the ...
13
votes
12answers
371 views

Find all \$k\$-smooth pairs

Introduction In number theory, we say a number is \$k\$-smooth when its prime factors are all at most \$k\$. For example, 2940 is 7-smooth because \$2940=2^2\cdot3\cdot5\cdot7^2\$. Here, we define a ...
18
votes
10answers
3k views

Program which behaves differently in/out of a debugger [closed]

The challenge is to write a deterministic program (any language/OS) which takes no arguments or other input and behaves differently in a debugger from how it behaves when not being debugged. For ...
15
votes
11answers
1k views

Automatically anti-predictably assemble an alliterative aria

Thanks to @ComradeSparklePony for the title. This challenge should be very simple. You are given three lists. The first is a list of first names, in title case. The second is a list of adjectives, ...
1
vote
1answer
102 views

Building a Structured Outline [closed]

In a fictional document management system, input documents are structured with weighted headings. Lowest weighted headings are the most important. This is a sample document: H1 All About Birds H2 ...
32
votes
5answers
581 views

Extrude the faces of a cube symmetrically along XYZ

Sandbox For the purposes of the current task, a cube of unit length is rendered in oblique projection with ASCII symbols as follows: ...
25
votes
41answers
7k views

As programmers say: Strive to be lazy

Story Have you seen this post from 9gag? Maybe you got the feeling to make your own sentences. But then you realize that you could just golf a script in half an hour, and you will never have to deal ...
12
votes
5answers
190 views

Country Code Transformations

Background and Motivation: IOC Country Codes are three letter abbreviations that are commonly used when broadcasting the Olympic Games. The last two letters of some codes overlap with the first two ...
20
votes
11answers
1k views

Make all the squares explode

You are given a square matrix of width \$\ge2\$, containing square numbers \$\ge1\$. Your task is to make all square numbers 'explode' until all of them have disappeared. You must print or return the ...
3
votes
10answers
359 views

Composite Factor Soup

Per the fundamental theorem of arithmetic, for a given number \$n\$, it is possible to find it's prime factors, and they are unique. Let's imagine we talk only of \$n\$ that is non-prime (composite). ...
8
votes
7answers
564 views

Output the date in the Mel calendar

The Mel calendar is used in the fictional world of Kaldia. Your goal is to convert dates into the Mel calendar. This calendar has 13 months of 28 days each, plus 1 or 2 extra days after the last ...
30
votes
19answers
5k views

Is it a Munchausen Number?

A Munchausen Number in base \$b\$, also known as a Perfect digit-to-digit invariant or PDDI is a peculiar type of positive integer where the sum of its base-\$b\$ digits raised to themselves is equal ...
9
votes
5answers
584 views

Hungry Blobs KoTH

Contest Finished! Read comments on blobs to view their score. This KoTH is loosely inspired by Primer's Natural Selection Simulation. Your bot is a blob. In order to survive, you must eat pellets to ...
0
votes
3answers
188 views

Roots of Arbitrary Numbers [closed]

One day, when I was bored in maths class, I learned of a neat trick for solving the real cube root of a number! Let's use the number \$79,507\$ as an example. First, take digit in the one's place ...
-1
votes
0answers
82 views

Check if the knight move in chess is valid or not? [duplicate]

Consider an array which represent chessboard. Its length is 64. The first 8 elements represents first row the next ...
11
votes
12answers
989 views

Magical Modulo Squares

I'm a big fan of number theory. A big thing in number theory is modular arithmetic; the definition being \$a\equiv b\mod m\$ if and only if \$m\mid a-b\$. A fun thing to do is raising to powers: ...
19
votes
2answers
391 views

Find the area of the smallest rectangle to contain squares of sizes up to n

This is a sequence question of the usual type, as applied to OEIS sequence A038666. That is, do either of the following: Accept no or any input, and output A038666 until the heat death of the ...
12
votes
17answers
3k views

Convert Numbers To Emoji Math [closed]

In Emoji Math, a user created module for the video game Keep Talking And Nobody Explodes, numbers are written as strings of emoticons, where each emoticon represents a base 10 digit. Below is the ...
13
votes
4answers
462 views

Rock, Paper, Scissors, Lizard, Spock Tournament

Giving a challenge involving a Star Trek reference just after May the 4th may be frowned upon, but here goes. You, Luke, Anakin, Palpatine, Yoda and Han Solo are involved in an insane tournament of ...
9
votes
10answers
624 views

Determine if a grid contains another grid

Challenge Create a function takes in two 2-dimensional arrays of Characters (or Strings if the programming language does not have characters as a datatype) as inputs: a and b. If your language does ...
26
votes
13answers
2k views

Make me a minimum magic sum

Keeping this challenge short. You are given 4 numbers: p1, p2, p3 and p4. The magic sum of the numbers are defined as follows: ...

15 30 50 per page