1
vote
0answers
76 views

Recursive zipper reincarnation

Recursive zipper reincarnation Objective: Code two separate programs A and B that when concatenating their respective outputs OA + OB creates a third program: C. When program C runs it should ...
6
votes
3answers
83 views

Asymmetrical KOTH: Catch the Cat (Catcher Thread)

Asymmetrical KOTH: Catch the Cat This challenge consists of two threads, this is the catcher thread, the cat thread can be found here. The controller can be downloaded here. This is an ...
8
votes
2answers
96 views

Asymmetrical KOTH: Catch the Cat (Cat Thread)

Asymmetrical KOTH: Catch the Cat This challenge consists of two threads, this is the cat thread, the catcher thread can be found here. The controller can be downloaded here. This is an ...
4
votes
8answers
271 views

Shift characters in a string

In this challenge, you are required to shift characters in an inputted string n number of times and output the shifted string Input Input will first contain a string. In the next line, an integer, ...
12
votes
5answers
688 views

XOR encrypt your programs with the source of other programs

Write two programs such that when the bytes of their source code are XOR-d together it produces a third, valid program, all in the same language. The length of each of the three programs in bytes must ...
17
votes
8answers
429 views

Make a slow error quine maker!

As part of his answer to Make an Error Quine!, @Falko proposed the following algorithm: How to create your own solution in 2 minutes? Open a new file in an IDE of your choice. Bang your ...
2
votes
0answers
62 views

Map of Islands (and a river)

Introduction For many centuries, there has been a certain river that has never been mapped. The Guild of Cartographers want to produce a map of the river, however, they have never managed to succeed ...
12
votes
4answers
315 views

Chinese checkerboard

The game of Chinese checkers is played on a board with spaces in the shape of a six-pointed star: Image from Wikipedia We can create an ASCII-art representation of this board, using . for empty ...
0
votes
1answer
56 views

Improving a Rubik's Cube scrambler's byte count

Okay, I recently wrote a Javascript Rubik's Cube scrambler that outputs a 25-move scramble. It's 135 bytes. The Gist is here, but for reference, I have the formatted code: function(){ ...
5
votes
1answer
116 views

Double-slit Quine

Objective: Code two programs where each of the programs outputs both source codes interlaced per character like a zipper, a Double-slit Quine. The output from a Double-slit Quine is starting ...
10
votes
7answers
692 views

Character counts in source code

Write a program that outputs a list of the number of occurrences of each unique character in its source code. For example, this hypothetical program {Source_Print_1}; should produce this output: ; 1 ...
13
votes
5answers
404 views

Determine the Dimensions of a Rotated Rectangle

This Stack Snippet draws an aliased white rectangle on a black background given parameters for its dimensions, position, angle, and the grid dimensions: <style>html ...
0
votes
1answer
85 views

Code Golf that outputs Code Golf [duplicate]

This might be a bit weird, and maybe way easier than I thought, or, on the other hand, next to impossible. The challenge is this: Create a code (either a program or a function) that it's output is ...
15
votes
7answers
2k views

Where should I put my restaurant?

You are the owner of a restaurant. You are opening in a new area in Cartesia where there is only one main road, known as the y-axis. You want to place your restaurant such that you minimize the total ...
8
votes
0answers
88 views

Matchstick Equations

Your task in this challenge is to analyize a given "Matchstick Equation" like this one... ... and to find out whether it can be turned into a valid equation by rearranging the matches. If so, you ...
18
votes
9answers
788 views

Calculating Collatz Cousins

Define the function f(n) for a positive integer n as follows: n / 2, if n is even 3 * n + 1, if n is odd If you repeatedly apply this function to any n greater than 0, the result always seems to ...
26
votes
6answers
2k views

Write A Program That Outputs Its Mirror Level

There are 95 printable ASCII characters: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ In the Consolas font (the Stack Exchange code ...
7
votes
7answers
532 views

Recursive Prime Factorization

Your job is to take the prime factors of a number taken from input (omitting any exponents equal to 1) then take the prime factors of all of the exponents, and so on, until no composite numbers ...
5
votes
0answers
182 views

Settlers of Catan - Longest Road!

This is an endgame board of Settlers of Catan: Background: The roads (the long stick pieces) and the settlements (and cities) are rendered by the little huts. We encode the placement of these ...
33
votes
19answers
2k views

Strategic Voting, The Game

One of the most common voting systems for single-winner elections is the plurality voting method. Simply put, the candidate with the most votes wins. Plurality voting, however, is mathematically ...
14
votes
2answers
242 views

Fix the Braces, etc

Your mission, should you choose to accept it, is to add the minimum number of parentheses, braces, and brackets to make a given string (containing only parentheses, braces, and brackets) have correct ...
17
votes
12answers
860 views

Expand an encoded string

There's the classic run length encoding and decoding. input output a3b2c5 aaabbccccc And that's fairly straight forward and done before. The challenge is to also account for a non-standard ...
12
votes
3answers
658 views

Is there a shorter way to get user input in python?

This is not a challenge. I'm wondering if it's at all possible to get user input into two separate variables in python (2 or 3) with less than 19 bytes. These are all the shortest I can get: ...
-3
votes
0answers
58 views

Create the block scheme of this algorithm [on hold]

Find the sum and the product of this range of numbers: 2,4,8, 16... a) till the number 1000 b) no ending number (I'm not sure this point is correct) I solved the a point but I don't know if it is ...
38
votes
10answers
3k views

Fissile Numbers

I found this sequence while working on Evolution of OEIS, but never got around to posting it as an answer. After writing a reference implementation in Mathematica, I thought this is a fun exercise to ...
-1
votes
0answers
134 views

Nash equilibrium

Your quest is to find the Nash equilibrium The simple definition and explanation: In game theory, the Nash equilibrium is a solution concept of a non-cooperative game involving two or more players, ...
11
votes
1answer
182 views

Save the Geese from Extinction

The species of geese known as Alex A are known for residing in triangular grids consisting of 64 cells: (Picture taken from this unrelated Project Euler problem.) We'll label each cell with the ...
5
votes
2answers
232 views

Generalized integer casting in Python

Background I have a string in Python which I want to convert to an integer. Normally, I would just use int: >>> int("123") 123 Unfortunately, this method is not very robust, as it only ...
12
votes
4answers
351 views

Packing Wood Pieces

There are two pieces of wood. Both consist of a straight body and some extra blocks below the body. An example piece with extra blocks at (0-indexed) positions 0,4,7,9,10: XXXXXXXXXXX X X X XX ...
12
votes
5answers
318 views

Permutations of the Fifteen Puzzle

The Challenge Consider the following diagram of the Fifteen Puzzle in its solved state: _____________________ | | | | | | 1 | 2 | 3 | 4 | |____|____|____|____| | | | | | ...
0
votes
0answers
52 views

what are the common challenges to develop on AWS platform? [on hold]

o the developer community out there: what are the common challenges to develop on AWS platform?
10
votes
1answer
357 views

XKCD Bracket Probabilities

Today's XKCD is a sports-tournament style bracket, where the contestants are well-known names, put into groups of possibly confusing names. Give the probability that a given contestant will win the ...
20
votes
23answers
2k views

Counting leap years

This challenge is quite simple. You will take an input which will be a year from 1801 to 2400, and output if it is a leap year or not. Your input will have no newlines or trailing spaces: 1954 You ...
9
votes
3answers
369 views

Sourcecode selfie

Objective: A guru once said a perfect code selfie is best shot diagonally from upper left corner. A code selfie is almost like a Quine - but rotated 45 degree clockwise. Your mission is to code a ...
16
votes
0answers
173 views

Let's build a race car track!

Introduction My niece wants to make a race car track. She has wooden parts that fit together to form the track. Each part is square shaped and contains a different shape. I'll use the pipe drawing ...
3
votes
1answer
154 views

Minimum of a Polynomial in Python

What is the shortest amount of code that can find the minimum of an inputted polynomial? I realize that you can import packages like Numpy and others, but using only user defined functions, what is ...
27
votes
5answers
933 views

Compute the Resistance of a 4 Band Color Coded Resistor

Resistors commonly have color coded bands that are used to identify their resistance in Ohms. In this challenge we'll only consider the normal 4-band, tan, axial-lead resistors. We'll express them as: ...
13
votes
9answers
835 views

Split as number, join as string, repeat

Consider the process of: Taking a non-negative integer N. e.g. 27. Spliting it into integers N - floor(N/2) and floor(N/2) (a 'bigger' and 'smaller' half) and writing them in that order. e.g.27 ...
4
votes
0answers
152 views

Stone Maze Chess solver [on hold]

Background: Every war eventually comes to an end, but the end is never absolute. The Stone Maze Chess scenario takes place after a game of chess is finished. The enemy King is dead and the pieces is ...
25
votes
7answers
1k views

Multiplication by Self-Modification

...at least for some definition of "self-modification". The Task In this challenge, your task is to write three strings A, B and C that satisfy the following properties. The string B has length at ...
31
votes
14answers
3k views

Temperature Converter

This is a byte sized challenge where you have to convert an input temperature in one of the three units (Celsius, Kelvin and Fahrenheit) to the other two. Input You would be provided with a ...
7
votes
3answers
209 views

Number of ways to sum [1..n] with [n+1..2n] such that each sum is prime

Let n > 0. Let X = [1..n] and Y = [n+1 .. 2n]. Define a(n) as the number of permutations p of Y such that every element of X + p(Y) is prime. For example: n = 2 X = [1,2] Y = [3,4] p0(Y) = [3,4] ...
13
votes
7answers
1k views

What is the Probability that a Knight Stays on Chessboard?

Given the size of the chess board and initial position of the knight, calculate the probability that after k moves the knight will be inside the chess board. Note: The knight makes its all 8 ...
33
votes
8answers
2k views

Clarence the Slow Typist

Introduction Clarence is a data entry clerk who works at an internet service provider. His job is to manually enter the IP addresses of all of the ISP's customers into the database. He does this ...
6
votes
3answers
224 views

Write a self replicating program that stops replicating after “printing” “Hello world!” with the filenames

Write a self replicating program, in the source code filename H.*, contianed in an empty folder then manually compile and run or just run the program if your chosen language is dynamic, and it should ...
5
votes
9answers
548 views

Take first letter of each word, leave spaces and punctuation

Shrink each word in a string of group of strings to single letters delineated by spaces or punctuation. Example I'm a little teapot, short and stout. Here is my handle, here is my spout. When I get ...
-1
votes
0answers
53 views

Check if number N is within possible combinations of a sorted array of numbers [duplicate]

For sorted array of integers X = [x1, x2, x3, ....] where x1 < x2 < x3, ... And integer Y Check if Y has a possible 1 or more integers in the array X that add up to equal the value of Y Test ...
0
votes
0answers
75 views

The polyglot challenge! [duplicate]

A polyglot is a program which can be run by several different language's interpreters/compilers without failing. For example, the stackoverflow 404 page contains a polyglot which runs in Python, ...
0
votes
0answers
36 views

Number of right cyclic shifts to give the biggest number [closed]

I am preparing to coding interview and I met this task today: You are given 30-bit unsigned integer N. A right cyclic shift of N by K bits is the result of performing a right cyclic shift of N by one ...
13
votes
5answers
749 views

It's election time!

It's time... to count the votes! Today there are local elections in my entire country. Here, the number of seats for each party is decided using the D'Hondt method. Your goal is to implement a ...

15 30 50 per page