All Questions

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
213 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
250 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
470 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 ...
39
votes
22answers
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
884 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
254 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 ...
18
votes
19answers
4k 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
170 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 ...
21
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
167 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
453 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
121 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
668 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 ...
7
votes
5answers
370 views

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 ...
16
votes
40answers
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
173 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
119 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
294 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
809 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
253 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
234 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
729 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
446 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
22answers
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
950 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....
3
votes
5answers
333 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
584 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
247 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
639 views

Determine the Widest Valley

Imagine we get a slice of some mountainous region, this would result in a shape similar to this: ...
12
votes
40answers
2k views

Print the Lost numbers

As a big fan of the Lost TV series, I always got intrigued by the sequence of numbers that repetitively appears on the episodes. These numbers are: \$ 4, 8, 15, 16, 23, 42\$ (A104101) Using any ...
14
votes
28answers
2k views

The inverse Collatz Conjecture

I think the Collatz Conjecture is already well-known. But what if we invert the rules? Start with an integer n >= 1. Repeat the following steps: If n is even, multiply it by 3 and add 1. If n is ...
14
votes
36answers
2k views

Sum square difference

The sum of the squares of the first ten natural numbers is, \$1^2 + 2^2 + \dots + 10^2 = 385\$ The square of the sum of the first ten natural numbers is, \$(1 + 2 + ... + 10)^2 = 55^2 = 3025\$ ...
0
votes
0answers
58 views

Multiples of 3 or 5 [duplicate]

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. For a given input n, find the sum of multiples of 3 or five between 1 ...
10
votes
0answers
249 views

Captcha Capture [closed]

Captchas aren't meant to be machine-readable, and that's terrible. It is time to end this obvious bout of unfounded hatred for machines just trying to let you know about great deals on ṗḧ@ṛḿ4ćëüẗ1ċäḷṡ ...
0
votes
4answers
429 views

Fastest algorithm to output array containing all integers in range excluding duplicate digits

Input is a single integer in ascending digit order. The only valid inputs are: 12 123 1234 ...
10
votes
15answers
1k views

Rosencrantz and Guildenstern are Code

In the absurdist play Rosencrantz and Guildenstern are Dead, the two main characters Rosencrantz and Guildenstern(or are they?) are always mixing up which of them is who—or sometimes which of their ...
14
votes
6answers
1k views

Ryley's Theorem

S. Ryley proved following theorem in 1825: Every rational number can be expressed as a sum of three rational cubes. Challenge Given some rational number \$r \in \mathbb Q \$ find three rational ...
3
votes
0answers
115 views

Number of circles packed into a rectangle [closed]

Calculate the maximum number of circles of radius r that can fit in a rectangle with width x and height ...
9
votes
4answers
236 views

Count the corners, edges and faces of a cut cube

Coming from this sandbox post This is inspired from an 8th graders math test Intro We have a cube with following corners ...

15 30 50 per page