All Questions

32
votes
42answers
4k views

Print all lexicographically increasing numbers under 10000

A lexicographically increasing number is an integer whose digits are in strictly increasing order. Print all lexicographically increasing numbers under 10000. Here are lines of the expected output: ...
12
votes
3answers
260 views

Unminify a Pythlike String

Pyth is perhaps the most successful general-purpose golfing language. Though it is somewhat in decline as a result of newer languages, from 2014 to 2016 Pyth's concise syntax, constant updates, ...
12
votes
11answers
2k views

Quaternion square root

Background Quaternion is a number system that extends complex numbers. A quaternion has the following form $$ a + bi + cj + dk $$ where \$ a,b,c,d \$ are real numbers and \$ i,j,k \$ are three ...
0
votes
2answers
148 views

Number letter counts [closed]

If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. Output how many letters would be used if all the numbers from ...
-2
votes
3answers
175 views

Golf some ones, and a program too [closed]

Introduction Busy Beavers are programs (specifically Turing Machine programs) that aim to output the most ones as possible, while having the least states as possible and halting. Challenge Your ...
7
votes
3answers
853 views

Largest Number in Brainfuck BigInt for each program length up to 50 instructions

This challenge is for the largest finite number you can get BrainFuck programs of given lengths to contain in memory. We must use one of the BF versions that uses big integers for the cells rather ...
19
votes
27answers
3k views

Strange Addition

Challenge Calculate the strange sum of two natural numbers (also known as lunar addition): Given A=... a2 a1 a0 and ...
16
votes
10answers
2k views

Largest and Smallest Possible Number

Task Given an array of non-negative numbers, output the largest and smallest possible number that can be formed by joining them. Rules Input,Output can be in any convenient format. The array may ...
23
votes
25answers
2k views

Sort by Largest Digit(s)

Challenge: Given a list of integer, sort descending by their single largest digit(s). The order for numbers with the same largest digit are then sorted by second largest digit, etc. We ignore ...
15
votes
9answers
1k views

Hide the buildings

Shorter version of Skyscrapers Challenge Task Given an array of building heights and a positive integer k, find all the permutations(without duplicates) of the ...
15
votes
30answers
2k views

Upward and onward to greater glory!

May this challenge serve as (another) tribute to Stan Lee, who passed away aged 95. Stan Lee has left us an invaluable legacy and a peculiar catch word: Excelsior. So here's a small challenge based ...
4
votes
2answers
214 views

Alignment of a string

This is similar to the alignment used in word. Task 3 inputs: A 1 line string, a positive integer k, and direction (left or middle or right) Your job is to ...
-2
votes
3answers
252 views

FreeChat Online [closed]

FreeChat Online It is 1985, and you are a humble Russian potato farmer. Sadly, your glorious homeland is going through a time of crisis and it needs your help! The KGB, with the "assistance" of your ...
6
votes
4answers
474 views

Calculate your Icy Tower Score

Do you know Icy Tower ? Here is a gameplay example of what i'm talking about The game concept is simple : you play as Harold the Homeboy, and your goal is to jump from floors to floors to go as high ...
42
votes
24answers
11k views

Tribute to Stan Lee

Unfortunately one of the greatest comic book writers passed away yesterday afternoon. Lots of Hollywood stars, musicians, actors, and many other people are paying tribute to this awesome writer, so we ...
10
votes
9answers
886 views

Terms of the EKG sequence

Introduction The EKG sequence begins with 1 and 2, then the rule is that the next term is the smallest positive integer not already in the sequence and whose common factor with the last term is ...
6
votes
3answers
255 views

Cut-Off The Matrix

Task Given is a square matrix of any dimension and any integer n. Output all possible matrices(without duplicates) by removing columns and rows from the input ...
17
votes
10answers
2k views

Reciprocal copycats

Let \$A\$ be a positive integer consisting of \$n\$ decimal digits \$d_1,d_2,...,d_n\$. Let \$B\$ be another positive integer. For the purpose of this challenge, we call \$A\$ a copycat of \$B\$ if ...
19
votes
19answers
5k views

Iterated Prisoner's Trilemma

CHALLENGE STATUS: OPEN Comment, open a PR, or otherwise yell at me if I'm missing your bot. Prisoner's dilemma ... with three choices. Crazy, huh? Here's our payoff matrix. Player A on the left, B ...
19
votes
27answers
5k views

Couch 2048: How much more till 2048?

I have just tried a game called Couch 2048. (Note: You should have a look to better understand this question.) Since it wasn't very exciting for me, I've been asking myself 'How much more till 2048!?' ...
8
votes
2answers
172 views

Should this identifier be suggested?

Introduction In Android Studio and other IDEs there are code completions to assist efficient code insertion (especially when the names of the classes or methods are so verbose), like the one in the ...
23
votes
15answers
2k views

All the single eights

Given a non-empty rectangular array of integers from 0 to 9, output the amount of cells that are ...
5
votes
3answers
175 views

Generate Matlab plot markers

Matlab has a useful command for visualizing data: plot. It draws data points using "markers" in 2-D space, connecting them with lines; however, for this challenge, ...
6
votes
5answers
456 views

Gold nugget storage

Given a positive integer, write it as the sum of numbers, where each of them is in \$\{kt|k\in{1,9,81},t\in{1,2,3,...,64}\}\$. How many numbers at least are used? Shortest code win. Samples: ...
-2
votes
3answers
122 views

Doce logf a string swapper [closed]

Challenge Take an input string \$s\$, and split it into words \$w_1, w_2, ..., w_n\$. If the amount of words is odd, then return \$s\$. Otherwise, for each word: Take the second last letter, and swap ...
14
votes
8answers
669 views

Outline words with their letters

For the purposes of the current challenge to "outline" a word means to surround it successively with its own letters, starting with the last one, and finally to replace the original word in the center ...
8
votes
6answers
511 views
+300

9erilous 9ermutations

Note: This is an attempt at recycling guest271314's permutation question(s) There's an interesting pattern that forms when you find the differences between lexographically sorted permutations of base ...
17
votes
42answers
2k views

Multiplicity Test

Use any programming language to display numbers between 1 and 99 (including both) in such a way, so that: the numbers are separated by single space, if a number is divisible by 3, it should be in ...
7
votes
4answers
174 views

Dina's Paintings

Dina loves most numbers. In fact, she loves every number that is not a multiple of n (she really hates the number n). For her friends’ birthdays this year, Dina has decided to draw each of them a ...
23
votes
11answers
2k views

Draw this diamond pattern

The below pattern will form the basis of this challenge. ...
10
votes
9answers
1k views

Through Space and Time

Introduction: In general we usually speak of four dimensions: three space dimensions for x, y, and ...
4
votes
3answers
598 views

Tips for golfing in Dart

Dart is an object oriented programming language borrowing from both Java and Javascript. What general tips do you have for golfing in Dart? I'm looking for ideas that can be applied to code golf ...
4
votes
0answers
129 views

Tips for golfing in Scratch

Scratch is a visual programming language. For the sake of counting bytes, Scratch is usually written in scratchblocks2 syntax. Post tips that specifically apply to Scratch or scratchblocks2.
8
votes
7answers
296 views

Magic: The Gathering, Paying for Spells

For more MtG-goodness: Magic: The Gathering Combat with Abilities Premise: In Magic: the Gathering, you cast spells by paying their mana cost by tapping lands for the required amount. These lands ...
1
vote
19answers
816 views

Spelling Bee Acceptable

This is similar to this question. However, I have a different goal in mind: Reduce the wordlist to words that could appear. The easy part is to delete hyphens and similar. The hard part, however: ...
4
votes
2answers
255 views

Find arrays with distinct subarray sums

Consider an array A of length n. The array contains only integers in the range 1 to ...
16
votes
9answers
2k views

Is this a Major Scale (or equivalent)?

Sandbox The major scale (or Ionian scale) is one of the most commonly used musical scales, especially in Western music. It is one of the diatonic scales. Like many musical scales, it is made up of ...
33
votes
53answers
5k views

The first, the last, and everything between

Given two integers, output the two integers, and then the range between them (excluding both). The order of the range must be the same as the input. Examples: ...
-7
votes
2answers
239 views

Colors weave into a spire of flames

https://www.youtube.com/watch?v=6vAhPeqlODg Ok—jig's up—this one's only related to smash in name, but it'll give you something to burn your time with while you wait 'til December 7th Given a color ...
7
votes
1answer
777 views

Count arrays that are really unique

This is a follow up to Count arrays that make unique sets . The significant difference is the definition of uniqueness. Consider an array A of length ...
14
votes
5answers
449 views

Professor at MIT needs an AP!

The 5-card magic trick involves a magician whose assistant gives them 4 shown cards and a hidden one, in this order, and the magician must guess the hidden one. WARNING: Solution below! Leave now or ...
22
votes
23answers
4k views

ASCII Art Octagons

Given an input integer n > 1, output an ASCII-art octagon with side lengths composed of n characters. See examples below: <...
22
votes
11answers
2k views

Smallest Integer Disk

This challenge is about finding the smallest disk that contains some given points. This is made somewhat trickier, however, by the fact that in this challenge, the disk's coordinates and radius must ...
9
votes
14answers
981 views

Parentheses sequences in lexicographical order

Challenge Taken from here and also here An n parentheses sequence consists of n (s and n )s. A valid parentheses sequence is ...
13
votes
6answers
2k views

Worded Calculator

A simplistic version of English numeral calculator Task Write a program that takes a string as input and outputs the result of the expression. Rules The input string will be worded and not numeral....
4
votes
5answers
343 views

Transformers in Disguise (Robbers' Thread)

The cop's thread is here The robber's task is to find a program of size equal to or less than the cop's program, which, when given an itself as input, produces the same output as the cop's program. ...
10
votes
13answers
600 views

Transformers in Disguise (Cops' Thread)

The robber's thread is here The cops task is to write a function or program that, when given an input of itself, outputs a finite deterministic string. If the program is given a different input, it ...
4
votes
1answer
227 views

All different functions

For functions \$f, g: \{0,1\}^n \rightarrow \{0,1\} \$, we say \$f \sim g\$ if there's a permutation of \$1,2,3,...,n\$ called \$i_1,i_2,i_3,...,i_n\$ so that \$f(x_1,x_2,x_3,...,x_n) = g(x_{i_1},x_{...
8
votes
3answers
255 views

Generate an RSA key pair

Given a positive integer \$N >= 4\$, output an RSA key pair (both the private and the public key) whose key length is \$N\$ bits. The RSA key generation algorithm is as follows: Choose an \$N\$-...
12
votes
6answers
641 views

Determine the Widest Valley

Imagine we get a slice of some mountainous region, this would result in a shape similar to this: ...

15 30 50 per page