instruction
stringlengths
34
53.1k
Positional Awareness Your task is to generate a program that, for every permutation of its characters (which includes the original program), outputs the positions of every character relative to the original program. If your program is Derp you must output [0, 1, 2, 3] (or some equivalent). This is because D is in the...
Task Your task is to write a program that will take input, and then output the lyrics to We Are Number One, changing specific words. The input will contain both the words to be changed, and the replacement word. Input The input will be in the following format: one, two\n net, villain\n (\n is a newline, it's not actua...
Almost six years ago, fellow PPCG member steenslag posted the following challenge: In a standard dice (die) the numbers are arranged so that opposite faces add to seven. Write the shortest possible program in your preferred language which outputs a random throw followed by 9 random tippings. A tipping is a quart...
The nutty maths professor wants to encode all of their research using a system sure to fox even the wiliest of their competitors! To this end the professor has decided to change the base of not just the number that they're writing but every single digit in that number, according to which place the digit finds itself in...
(related/inspired by: Draw a bowling formation) A fun pastime in the winter months here is to perform snowman bowling, using a large ball (like a basketball) and tiny snowman figures. Let's recreate this in ASCII. Each snowman consists of the following: (.,.) ( : ) Here is the alignment of the ten snowman "pins" (.,.)...
Given two input integers, a >= 4 and b >= 2, output an ASCII square of size a x a. The twist is the square must be constructed of b 3 x 3 squares formed like the following: ### # # ### You can use any ASCII printable character (except whitespace) to construct the smaller squares. I'm using # for visibility and consist...
Challenge Given a non-empty array of integers, e.g.: [5, 2, 7, 6, 4, 1, 3] First sever it into arrays where no item is larger than the previous (i.e. non-ascending arrays): [5, 2] [7, 6, 4, 1] [3] Next, reverse each array: [2, 5] [1, 4, 6, 7] [3] Finally, concatenate them all together: [2, 5, 1, 4, 6, 7, 3] This sh...
Braid Description In this braid, when a strand crosses over the top of another strand it adds the other strand's value to itself and all other strand values pass through. The braid has three strands and each strand begins at 1. The first crossover is the leftmost strand crossing over the middle strand. The next crossov...
Challenge Write a non-empty program/function p that, given a non-empty input string s, outputs the position of the first occurrence of each character of s in the source code of p. For example, if your program is main() { cout << magic << cin } ^0 ^5 ^10 ^15 ^20 ^25 and it receives an input abcd{, the output sh...
The Baum-Sweet Sequence (A086747 with a Twist) Take in a positive integer n and print the integers from 1 to n for which the Baum-Sweet sequence returns true. The Baum-Sweet sequence should return falsy if the binary representation of the number contains an odd number of consecutive zeros anywhere in the number, and tr...
Given an integer n, output the first n sloping binary numbers, either 0- or 1-indexed. They are called this because of how they are generated: Write numbers in binary under each other (right-justified): ........0 ........1 .......10 .......11 ......100 ......101 ......110 ......111 .....1000 ......... Then, you need t...
Print a tower block with the shortest possible code. Input: The input defines how many floors the tower block has. One floor contains a window on either side of the door. The window is made up of 3x3 hashes. An example of a 4 storey tower block is below: ===================== )V V V V V V V V V V( )V ...
The Task Write a program or function which, when passed some positive integer n as input, returns Mills' Constant accurate up to n digits. The Definition Mills' Constant worked out to six thousand digits may be located here. Examples Let f be the function described by the challenge. >>> f(1) 1 >>> f(3) 1.31 >>> f(100...
The simple part: Given an input string containing only printable ASCII-characters (space - tilde), count the number of occurrences of each character and return the result on any convenient format. The result for a string a%hda7a should be something like: a:3, %:1, h:1, 7:1, d:1. Sorting is unnecessary, the delimiters a...
Given a string n, create a pyramid of the string split into pieces relative to the current row. The first row contains the string unmodified. The second row contains the string separated into halves by a pipe. The third row separates it by thirds... And so on. The length of each substring, where l is the length of st...
Challenge Given a polynomial \$p\$ with real coefficients of order \$1\$ and degree \$n\$, find another polynomial \$q\$ of degree at most \$n\$ such that \$(p∘q)(X) = p(q(X)) \equiv X \mod X^{n+1}\$, or in other words such that \$p(q(X)) = X + h(X)\$ where \$h\$ is an arbitrary polynomial with \$ord(h) \geqslant n+1\...
Your task is to write a full program or function that takes no input and runs any type of loop (while, for, foreach, do, do-while, do-loop, goto, recursion, etc) that will end in causing an error, which means that the program must stop itself running and exit. Rules: The error must be a run-time error, unhandled excep...
Create a program that prints all whole numbers inclusively between an interval (a, b), and replaces multiples of 8 in the sequence with random (uniformly distributed, independent of other characters), non-numeric, non-whitespace, printable ASCII characters. Assume 0 < a < b in all cases. If the number has more than 1 ...
This is my first golf contest. What you need to do Build me, in the shortest amount of bytes possible, my AC remote control system. My room is too cold right now, and I'm missing my remote. Now, I don't want you literally building it or anything, just golf this: A slow increment of temperature, starting at 40 degrees, ...
Given a String and an Array as input, your task is to output the text the input String will print when typed on a typical Mobile Keypad. In a Mobile Keypad, a letter is typed by pressing a button n times, where n is the position of where the letter is at on the button's label. So, 22 should output b. Rules The Helpe...
Your task is to implement integer sequence A130826: an is the smallest positive integer such that an - n is an entire multiple of 3 and twice the number of divisors of (an - n) / 3 gives the nth term in the first differences of the sequence produced by the Flavius Josephus sieve. Lost yet? Well, it's actually quite e...
Given an integer n output the nth iteration of the Hilbert Curve in ASCII using the characters _ and |. Here are the first 4 iterations: n=1 _ | | n=2 _ _ | |_| | |_ _| _| |_ n=3 _ _ _ _ | |_| | | |_| | |_ _| |_ _| _| |_____| |_ | ___ ___ | |_| _| |_ |_| _ |_ _| _ | |___| |___| | n...
Mathemania Specs: Every piece of Mathemania code starts off with the number 2. From the 2, you can do the following operations: e: Exponentiation. This command's default is squaring the number. f: Factorial. This command's default is using the single factorial on the number (using f on 2 = 2! = 2). r: Root. This comma...
Your task is simple: write a program that will replace random pixels in a black 16px * 8px rectangle (width by height) with a white pixel. The holes must be uniformly random, and you should output the 16px by 8 px image with the white pixels inserted. Replace only 1 pixel per column (16 total replaced pixels) You don'...
It's Christmas everybody, and here's a code-golf challenge to celebrate. You need to make a program to print out a present. Specifically, the words "Merry Christmas". BUT, there is a catch: this program must only work if it is the 25th of December. If the code is run on any other day, then the program should crash. Thi...
Warning: DO NOT take medical advice from this post. If you want medical advice, go to a qualified professional. I have a headache. I need headache pills. I'll tell you the last few doses I've had, and you tell me when I can have my next dose, without overdosing. I'll give you this string: P: 00:00, I: 02:00, P: 04:00, ...
Your task is to create a program or function that creates a paste on sprunge.us. Your program/function must receive the text to sprunge from your language's usual input mechanism, such as standard in; or in the case of a function, it can be a string or whatever makes the most sense to you. Your program will POST the te...
A number is a Mersenne Prime if it is both prime and can be written in the form 2n-1, where n is a positive integer. Your task is to, given any positive integer, determine whether or not it is a Mersenne prime. You may submit either a function which returns a truthy/falsy value, or a full program which performs IO. ...
Your task is to create a program that is to mimic Big Ben (Twitter). Task Whenever a new hour has begun (according to your computer's local time or UTC), you have to output BONG repeated hour times (with a space between the words). For example, when it's 3 o' clock, you have to output BONG BONG BONG. The time format fo...
Output the following excerpt from Pachelbel's Canon in D as audio: Rules Any format/encoding may be used, so long as a codec existed prior to the creation of this challenge Any instrument (a real instrument, MIDI synthesis, etc.) may be used The tempo must be 65 BPM (as notated in the sheet music) - if you cannot get...
This is a code golf. The smallest amount of bytes wins! :) What you need to do You're on Deep Space Nine, a Cardassian outpost taken over by the Federation, in the year 2374. The Borg, a superior race, have collapsed your shields and assimilated half of your crew. However, you have important classified information on y...
Background The Sidi polynomial of degree \$n\$ – or the \$(n + 1)\$th Sidi polynomial – is defined as follows. $$S_n(x) = \sum^n_{k=0}s_{n;k}x^n \text{ where } s_{n;k} = (-1)^k\binom n k (k+1)^n$$ The Sidi polynomials have several interesting properties, but so do their coefficients. The latter form OEIS sequence A0755...
We had a prime factorization challenge a while ago, but that challenge is nearly six years old and barely meets our current requirements, so I believe it's time for a new one. Challenge Write a program or function that takes as input an integer greater than 1 and outputs or returns a list of its prime factors. Rules I...
Today, we're going to make an ASCII hexagon. You must write a program or function that takes a positive integer n, and outputs a hexagon grid of size n, made up of asterisks. For example, a hexagon of size 2 looks like this: * * * * * * * While a hexagon of size 3 looks like this: * * * * * * * * * * * * * * * *...
Goal Given an string with a train of hashes, calculate its total length and divide by the distance from start to finish. Simulation What are we simulating? According to this paper, the ratio of the length of a river to the distance between start and end is approximately Pi! (This may have been disproved empirically, bu...
Given a number n >= 2, output all the positive integers less than n where gcd(n, k) == 1 (with k being any one of the output numbers).  Numbers of this sort are coprime to each other. Example: 10 gives the output [1, 3, 7, 9] (in any form you like, as long as the numbers are unambiguously separated and in some sort of ...
Given a positive number n, output all distinct multiplicative partitions of n in any convenient format. A multiplicative partition of n is a set of integers, all greater than one, such that their product is n. For example, 20 has the following distinct multiplicative partitions: 2 * 2 * 5 2 * 10 4 * 5 20 Order does no...
A program is bit primed if bits in prime positions must alternate between zero and one, starting with one. For example, this is a template for a bit primed program with [0..47] bits. ..10.1.0 ...1.0.. .1.0...1 .....0.1 .....0.. .1.0...1 01234567 89012345 67890123 45678901 23456789 01234567 Create a bit primed program...
The Biham-Middleton-Levine traffic model is a self-organizing cellular automaton that models simplified traffic. It consists of a number of cars represented by points on a lattice with a random starting position, where each car may be one of two types: those that only move downwards (shown as blue in this article), a...
Given a rectangular grid of text, line up the diagonals that go from the upper-left to the bottom-right into columns such that the lowest-rightmost characters of all diagonals are on a level. Use spaces for indentation. For example, if the input grid of text is abcd 1234 WXYZ then you'd line up the diagonals W, 1X, a2...
This challenge is inspired by this fantastic animated diagram (thanks to flawr for posting it in chat). Given an input n, draw all of its prime factors as nested polygons of dots, as specified. For example, given the number 357 = 17x7x3, you arrange 3 dots in a triangle, 7 versions of those triangles in a heptagon, and...
For any positive 32-bit integer (1 ≤ n ≤ 0xFFFFFFFF) output the number of bits needed to represent that integer. Test cases | n | n in binary | bits needed | |----------------------------------| | 1 | 1 | 1 | | 2 | 10 | 2 | | 3 | 11 | 2 | | 4 | 10...
You are to create a program that creates exact clones of itself infinitely until stopped. Whatever is in the original program must be in the clones. In other words, the clones and original program are the same in every way except for that the clones don't have to be in the same type of file as the source code (they can...
The challenge is simplistic, given an input time as a string in any one of the following formats: hh, hh:mm or hh:mm:ss with 0 ≤ hh ≤ 23, 0 ≤ mm ≤ 59 and 0 ≤ ss ≤ 59. Output what time it currently is using the following symbols: AA LABEL FOR CHARACTER CODE POINT HEXADECIMAL == ==================== ==========...
Above, you can see an image full of different colours. Click here for a hex-dump. One possible way to generate this image is by using a linear gradient rotated 90 degrees, however, this may not be the only way. Your task is to create a self-contained program that takes no input, and outputs an image with the same RGBA...
Your task is to create a program that, when run, returns itself as output (this is known as a quine). However, this quine must, when it is copied n times, returns the quine, but with each of its characters duplicated in place n times, where n is a positive integer. If your original program is Derp: Derp -> Derp (must r...
The Background Future In the year 2017, you and your opponent will face off in a futuristic gun battle where only one may survive. Are you experienced enough to defeat your opponent? Now is the time to polish your guns skills in your favorite programming language and fight against all odds! Tournament Results This tour...
We often get restricted-source questions here on PPCG that favour submitting solutions using only a subset of characters (sufficiently so that there's a tag printable-ascii that identifies a particular subset of those challenges). Wouldn't it be nice if we could automatically cut languages down to a subset of their nor...
Goal: Given a hand of 5 cards, determine its value in the game Cribbage. Input a string through any reasonable means. You can assume the string will always be in this format: [Card Value][Card Face],[Card Value][Card Face],[Card Value][Card Face],[Card Value][Card Face],[Card Value][Card Face] Valid Card Values: A,2,...
This is similar to prime factorization, where you find the smallest prime factors of a number (i.e. 8 = 2 x 2 x 2). But this time, you are to return an array/list of the smallest composite factors of any given positive integer n. If n is prime, simply return an empty list. Examples: Prime: n = 2 Result: [] Composite ...
Inspired by this challenge Given an integer in the range 0 <= n < 2**64, output the minimum sized container it can fit in out of bit: 1 nibble: 4 byte: 8 short: 16 int: 32 long: 64 Testcases: 0 -> 1 1 -> 1 2 -> 4 15 -> 4 16 -> 8 123 -> 8 260 -> 16 131313 -> 32 34359750709 -> 64 This is code-golf, so the shortest ans...
You're sick of other players smugly announcing "BINGO" and walking triumphantly past you to claim their prize. This time it will be different. You bribed the caller to give you the BINGO calls ahead of time, in the order they will be called. Now you just need to create a BINGO board that will win as early as possible f...
You are Ruby, a railway engineer. Your task is to lay track in any given valley such that it visits every station (M). The amount of track laid is not important, but it must be laid in one continuous path which starts and ends at the valley entrance/exit point (>) and does not, at any point cross itself. There are a fe...
Gaussian blur is a method used for blurring images smoothly. It involves creating a matrix which will be used by convolving it with the pixels of an image. In this challenge, your task is to construct that matrix used in Gaussian blur. You will take an input r which will be the radius of the blur and an input σ which w...
This is a 3x3 ASCII jigsaw puzzle: _____ _____ _____ | _| |_ | | (_ _ _) | |_ _|_( )_|_ _| | (_) |_ _| (_) | | _ _) (_ _ | |_( )_|_ _|_( )_| | _| (_) |_ | | (_ _) | |_____|_____|_____| This is also a 3x3 ASCII jigsaw puzzle: _____ _____ _____ | |_ _| | | _ ...
This challenge is in honor of the tacky Christmas lights at my in laws' house. The challenge is to create a graphical output showing the decoration in "real time". The video (gif or other format) will have n-by-m vertical and horizontal "lights". 5 <= m,n <= 40. The frame size and resolution may vary dependent on n a...
This is based off a previous deleted challenge of mine with the same name Introduction You are tasked with writing a program that returns a truthy or falsey value based on if the input has all its XML-like1 tags appropriately opened and closed and in the right order. Consider the following as input: <Apple> This would...
Goal: Given any natural number k such that k<256, produce an deadfish program that gives the smallest solution possible. Background: Deadfish is a joke esoteric programming language. It has a single unsigned byte of memory, called the accumulator, initialized at 0. There are four commands which form a string. i = accu...
The presents have been opened. The mince-pies have been eaten. The Star Wars have been watched. The Christmas Season is beginning to wind down. By now you may well have pulled a few Christmas Crackers. If you're lucky, instead of the usual useless plastic toys, you may have won a Mystery Calculator with which you ...
Today is Bacon Day which is probably why the name of the hat for participating today is "Mmmm Bacon". What better way to celebrate bacon day with fun filled 2d matrices made out of bacon! A 1 by 1 bacon strip is represented by this: ----- )===) (===( )===) ----- You goal here is given two coordinates in a tuple, (x,...
Yes, really. Print it with a hardware printer to create a hard copy. Send the necessary commands/data to your printer such that the following text is printed on a piece of paper: Hello, World! You may use any local- or network-connected printer that is available to you. If your printer allows, you should use 8pt or...
Mini-Flak is a subset of the Brain-Flak language, where the <>, <...> and [] operations are disallowed. Strictly speaking it must not match the following regex: .*(<|>|\[]) Mini-Flak is the smallest known Turing complete subset of Brain-Flak. A little while ago I was able to make a Quine in Mini-Flak, but it was too...
A vector partition is splitting a vector up a series of vectors such that their sum is the original. Here are a couple partitions: [3, 1, 2] = [3, 1, 2] [3, 1, 2] = [0, 0, 1] + [0, 0, 1] + [0, 1, 0] + [1, 0, 0] + [2, 0, 0] [3, 1, 2] = [1, 1, 2] + [2, 0, 0] Here vector addition is done element-wise. A valid partition d...
Introduction From Wikipedia: A tessellation of a flat surface is the tiling of a plane using one or more geometric shapes, called tiles, with no overlaps and no gaps. A fairly well known tessellation is shown below: The rhombi are tiled in a fashion that results in no overlaps or gaps, and simulates interchanging c...
Given an integer between 0 and 141 (inclusive), list all 24-hour times whose hour, minute, and second units add to that integer. Rules of addition Numbers are added by their time units, not by single digits. For example, take 17:43:59 17+43+59=119 Remember, that is an example of digits being added. In reality, you wou...
Challenge The challenge is simple: Taking no inputs and output the following message: _ __ __ | | | | | |_ |__| | | A number of times equal to the number of hours before or after midnight UTC on 31st Dec 2016. Examples For example if it is 19:01 UTC dec 31st you should output: _ __ __ |...
You probably all know the fibonacci sequence: fibonacci(n)=fibonacci(n-1)+fibonacci(n-2) fibonacci(0)=0 fibonacci(1)=1 Your task is as simple as it could be: Given integer N compute fibonacci(n) but here is the twist: Also do negative N Wait. What? fibonacci(1)=fibonacci(0)+fibonacci(-1) so fibonacci(-1)=1 and f...
For this challenge, you are to output the result of the sum of some numbers. What are these numbers? Well, you are given input, (a, b), which are integers (positive, negative, or zero) , a != b, and a < b , and each integer within a and b (including them) will have exponents according to the Fibonacci numbers. That's c...
In this challenge you'll be building a program that grows as it traverses through the ages… Until it's 2017. Challenge Whenever this challenge description says “program”, you can also read “function”. Your submission, when executed, will output a program that is THE LENGTH OF YOUR SUBMISSION + 1 bytes long. When that p...
(Note: although related, this challenge is not a duplicate of this one because it requires determining leap seconds automatically rather than hardcoding their times, and is not a duplicate of this one because most of the difficulty comes from determining the time without leap second skewing, something that most time A...
Your bird has been itching for some exercise and is sick of being stuck in static positions all the time. Write a program that will show a randomly dancing ascii bird, updating every 100ms*n or 200ms*n depending on the dance move. The bird always begins with the dance move <(")>. The program should accept one input whi...
Out of all the years I've been making this challenge, 2017 is the first year that's been a prime number. So the question will be about prime numbers and their properties. Your task is to produce a program or function that will take an arbitrarily large positive integer as input, and output or return whether or not the ...
Introduction Similar to the Fibonacci Sequence, the Padovan Sequence (OEIS A000931) is a sequence of numbers that is produced by adding previous terms in the sequence. The initial values are defined as: P(0) = P(1) = P(2) = 1 The 0th, 1st, and 2nd terms are all 1. The recurrence relation is stated below: P(n) = P(n - ...
Given a polynomial \$p(x)\$ with integral coefficients and a constant term of \$p(0) = \pm 1\$, and a non-negative integer \$N\$, return the \$N\$-th coefficient of the power series (sometimes called "Taylor series") of \$f(x) = \frac{1}{p(x)}\$ developed at \$x_0 = 0\$, i.e., the coefficient of the monomial of degree ...
Background The computer game NetHack dates from 1987, before the use of graphics in computer games was widely established. There are lots of monsters in the game, and potentially a lot need to fit on screen at once, so monsters are drawn in a very minimal way: a monster is simply drawn as an ASCII character on screen. ...
This is the ASCII version of this challenge. The initial post was separated per request by Martin Ender Introduction Similar to the Fibonacci Sequence, the Padovan Sequence (OEIS A000931) is a sequence of numbers that is produced by adding previous terms in the sequence. The initial values are defined as: P(0) = P(1) =...
Many electronic devices, specially old ones, will show a blinking 12:00 when the time has not been set. The purpose of this challenge is to recreate this. Specifically, the task is to display 12:00 and --:-- alternatively in an infinite loop. The period should be 1 second, divided evenly in two periods of 0.5 seconds. ...
I'm always forgetting Pokemon type matchups. This is a challenge to print the pokemon type chart! Attacking Type No Fi Fl Po Gr Ro Bu Gh St Fr Wa Gr El Ps Ic Dr Da Fa Normal 1.0 2.0 1.0 1.0 1.0 1.0 1.0 0...
0xUsernames There's so many people using a messaging service that they're running out of space to store all the usernames! To fix this, they are going to start storing usernames as hexadecimal, where possible. If a username consists of only the characters 0123456789ABCDEF (case insensitive), it can be converted to a ...
Challenge Given a colour raster image* with the same width and height, output the image transformed under Arnold's cat map. (*details see below) Definition Given the size of the image N we assume that the coordinates of a pixel are given as numbers between 0 and N-1. Arnold's cat map is then defined as follows: A pixe...
The Wilson score interval is a confidence interval of the probability of success, based on the proportion of successes in a set of Bernoulli trials (a Bernoulli trial is a trial in which exactly two outcomes are possible: success or failure). The interval is given by the following formula: The two values given by the ...
About a year ago on Dec 31, 2015, I had the idea that: We should make a time capsule string. Everybody gets to add one character and next new years we'll see who can make the best program out of all the characters with the esolangs that exist then. Doorknob graciously collected characters from the PPCG community and ...
This challenge is simple enough that it's basically all in the title: you're given a positive integer N and you should return the smallest positive integer which is not a divisor of N. An example: the divisors of N = 24 are 1, 2, 3, 4, 6, 8, 12, 24. The smallest positive integer which is not in that list is 5, so that'...
Introduction Consider a sequence of integers \$f\$ defined as follows: \$f(2) = 2\$ If \$n\$ is an odd prime, then \$f(n) = \frac{f(n-1) + f(n+1)}2\$ If \$n = p\cdot q\$ is composite, then \$f(n) = f(p)\cdot f(q)\$ It's not very hard to see that \$f(n) = n\$ for every \$n \ge 2\$, and thus computing \$f\$ wouldn't be...
Challenge description Dominoes is a game played with tiles with two values on it - one on the left, one on the right, for example [2|4] or [4|5]. Two tiles can be joined together if they contain a common value. The two tiles above can be joined like this: [2|4][4|5] We'll call a sequence of n joined tiles a chain of le...
Introduction The well-known "Die Hard with a Vengeance" water jugs puzzle challenges the two heroes to get 4L of water in a 5L container, provided an unlimited supply of water and another container of 3L. This problem has a solution because 4 is less or equal than the largest container and is a multiple of the gcd(5, 3...
There seems not to be a contest for this one yet. The task is simple. Add the first n numbers of the Fibonacci sequence that are even and output the result. This is given by OEIS A099919, except that sequence is shifted by one, starting with fib(1) = 0 instead of fib(1) = 1. This is code golf. Lowest byte count wins. E...
Using the 74 characters from the 2016 time capsule string H@~*^)$.`~+1A|Q)p~`\Z!IQ~e:O.~@``#|9@)Tf\eT`=(!``|`~!y!`) Q~$x.4|m4~~&!L{% write N code snippets all in the same language where: The 1st snippet outputs 1. The 2nd snippet outputs 2. The 3rd snippet outputs 3. ... etc. ... The Nth snippet outputs N (the number...
Preface The available keys are the keys of the A through G and A minor through G minor. The Challenge Create a program that creates and saves to a playable audio file a "song" of using (uniformly distributed) random chords. The song must be of length n and in key k. The chords in each "song" must conform to the key. If...
The question's pretty much described by the title: write a program or function that takes a positive integer n as input, and returns the smallest positive output which has all integers from 1 to n as factors. (Another way of looking at this is that you're looking for the least common multiple of the integers from 1 to ...
Word's A▲ and ᴀ▼ buttons change the font size according to these rules: The starting font size is 11. If ᴀ▼ is pressed when the font size is 1, the size stays 1. The font size changes with 1 point in the range 1 – 12. The font size changes with 2 points in the range 12 – 28. The choices are 28, 36, 48, 72, and 80 in t...
This challenge is about converting 2D mazes into 1D mazes. Overview +-+-+-+-+-+-+ +-+-+-+-+-+-+ graph { | | | | |A| | B| A B A -- D + + + + +-+-+ + + + + +-+-+ \ | C -- D | | | | | | | | \ | D -- E +-+-+ +-+-+ + +-+-+...
So you are given a POSITIVE base 10 (decimal) number. Your job is to reverse the binary digits and return that base 10 number. Examples: 1 => 1 (1 => 1) 2 => 1 (10 => 01) 3 => 3 (11 => 11) 4 => 1 (100 => 001) 5 => 5 (101 => 101) 6 => 3 (110 => 011) 7 => 7 (111 => 111) 8 => 1 (1000 => 0001) 9 => 9 (1001 => 1001) 10 => ...
Given a 2D string as input, either as a string with newlines or a list of lines, output the coordinates (x, y) of all the hashes (#) in the list. The input will only contain hashes and spaces. (and newlines, if you choose to take input as a 2D string) If there are no hashes, you can output anything. Output should be...
The task at hand is, given a number n, find the smallest prime that starts with AT LEAST n of the number 2 at the beginning of the number. This is a sequence I found on OEIS (A068103). The first 17 numbers in the sequence are given below, if you want more I'll have to actually go implement the sequence, which I don'...
Related: Music: what's in this chord?, Notes to Tablature, Generating guitar tabs?, Translate number pairs to guitar notes Given a guitar fingering, output the chord it represents. You can use standard input and output, or write a function that returns a string. The input fingerings will be classifiable as one of the f...
(Inspired by this comment on an old question.) Background An error quine (also known as a "Kimian quine") is a program which, when compiled or run, causes the compiler/interpreter/runtime to print an error message that has identical text to the program itself, and nothing else. For the purposes of this challenge, we're...
Challenge Print the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 The catch is that you may not use any one of them in your code. You may print them in arbitrary order, with or without a leading or trailing newline, but you may not print any other characters. Rules You may not ...
Given 2 integer inputs representing the size of the field, x and y, output a path through the field. Example output for 5, 4: # # # ### ### # The whole field is 5 by 4, and there is a path made of hashmarks crossing the field. The path should always start in the top left corner, and go to the bottom right. T...
While similar to the other water-carrying puzzle, the unique aspects of this challenge make it entirely different. Beth is located at an oasis in the middle of a desert. There is plenty of water in the lake, but unfortunately there are only X buckets, each of which has a capacity of Y liters of water. Beth can carry 2...