instruction
stringlengths
34
53.1k
Introduction On March 24th, 2015 @isaacg golfed his Pyth answer from 44 to 42 bytes. Since a crossed out 44 (44) looks a lot like a regular 44, @Optimizer made the following comment: striked out 44 is still normal 44 :( After that, on October 21st, 2015, @Doorknob♦ golfed his Ruby answer from 44 to 40 (and later 38) ...
When you roll a die, you have a 6:1 chance of any given option. There's a bookmaker taking bets on die rolls. He owns £20 at the start of the game. The bookmaker offers odds of 4:1, but gamblers take it, because there's money on offer. There are 10 gamblers. A, B, C, D, E, F, G, H, I, and J. Each gambler owns 10 pounds...
Challenge We take three positive integers a, b, and c as input. Using these integers, first create a sequence in the range [0, c] (inclusive on both ends), in steps of b. For example, for a=4, b=2, c=100, the sequence would be [0,2,4,...,96,98,100]. For every number in this sequence which is divisible by a, replace it ...
Challenge Write a program that greets a user depending on what time of day (GMT) it is. Output A string (printed or returned) according to these rules: If the time is 06:00 to 11:59 the greeting has to be "Good morning" If the time is 12:00 to 17:59 the greeting has to be "Good afternoon" If the time is 18:00 to 19:5...
Note: The survey for community favorite will be released soon In this KoTH, the aim is to be the last bot alive. Coins will be placed in random areas, and your bot must get the coins first. If a bot runs into another bot, the bot with more coins wins, and the other bot dies. More details below. Coin types There will ...
Given an integer \$N>3\$, you have to find the minimum number of bits that need to be inverted in \$N\$ to turn it into a square number. You are only allowed to invert bits below the most significant one. Examples \$N=4\$ already is a square number (\$2^2\$), so the expected output is \$0\$. \$N=24\$ can be turned int...
In 1.13, Minecraft language files were switched from being a simple multi-line key=value format to JSON. Challenge Write a program converting from the original format returning a JSON string. Input can be taken using any standard input method, output must be json from any standard output method The original format cont...
Display the 12 numbers on a clock face exactly like this: 12 11 1 10 2 9 3 8 4 7 5 6 To better see the grid, here's one with dots: ...........12............ ....
Quine Relay! A quine relay of order \$n\$ is a series of programs \$P_1\dots P_n\$ in distinct languages such that each program \$P_i\$ outputs \$P_{i+1}\$ and \$P_n\$ outputs \$P_1\$. For example, a 2-quine relay can be seen here: Ruby → Perl 6: This Ruby program: $><<"print (" p (DATA.read*2).chars.map(&:ord) $><<".m...
Your goal is to determine whether a given number n is prime in the fewest bytes. But, your code must be a single Python 2 expression on numbers consisting of only operators the input variable n integer constants parentheses No loops, no assignments, no built-in functions, only what's listed above. Yes, it's possible...
It's been a while since I posted here, so here we go another day another challenge. Challenge : Given a number(n) split it into it's prime factors. Input : A positive non-zero integer greater than 2. Output : Decompose the number into it's prime factors and return the number of occurances of each prime in it. Ouput...
Background This challenge is inspired by this website, which published the following diagram: This diagram shows us that the longest Roman Numeral expression under 250 is that of 188, which requires 9 numerals to express. Challenge The standard symbols used to express most Roman Numerals are the following: {I, V, X, L...
Back to back challenges I guess. Hopefully this one is more clear than the last. Background I was playing around with Goldbach's conjecture, and decided to plot evens (on the x-axis) vs the number of ways that two primes could be found to sum to a given even on the y axis. The two plots I've made below in Python are fo...
The reverse-then-add (RTA) sequence is a sequence obtained by adding a number to its reverse, and repeating the process on the result. For eg., $$ 5 + 5 = 10 \Rightarrow 10 + 01 = 11 \Rightarrow 11 + 11 = 22 \Rightarrow 22 + 22 = 44 \Rightarrow\text{ }... $$ Thus, 5's RTA sequence contains 10, 11, 22, 44, 88, 176, et...
In chess, a knight can only move to the positions marked with X relative to its current position, marked with ♞: A Knight's Graph is a graph that represents all legal moves of the knight chess piece on a chessboard. Each vertex of this graph represents a square of the chessboard, and each edge connects two squares th...
Let \$L\$ be a list of positive integers with no particular ordering, and which can contain duplicates. Write a program or function which outputs a list of positive integers \$M\$ (whose ordering is unimportant) such that merging \$L\$ and \$M\$ results into the smallest list which can entirely split into identical ran...
Challenge Given an ASCII representation of a Babylonian number as input, output the number in Western Arabic numerals. Babylonian Numeral System How did the Babylonians count? Interestingly, they used a Base 60 system with an element of a Base 10 system. Let's first consider the unit column of the system: The Babylonia...
Given the Dowker notation of a knot and its crossing signs, calculate its bracket polynomial. Although there are more technical definitions, for this challenge it is enough to think of a knot as something made physically by attaching the two ends of a string together. Since knots exist in three dimensions, when we draw...
Consider the following alphabetically sorted list of words: balderdash ballet balloonfish balloonist ballot brooding broom All of the words start with b, and the first 5 start with bal. If we just look at the first 2 words: balderdash ballet we could write instead: balderdash +let where the ' ' is used where a wor...
The Hamming distance between two strings of equal length is the number of positions at which the corresponding characters are different. If the strings are not of equal length, the Hamming distance is not defined. Challenge Write a program or function that finds the largest Hamming distance from among all pairs of str...
Introduction: (Source: Wikipedia) When we look at a rainbow it will always have the colors from top to bottom: Red; orange; yellow; green; blue; indigo; violet If we look at these individual rings, the red ring is of course bigger than the violet ring. In addition, it's also possible to have two or even three rainbow ...
Introduction: (Source: Wikipedia) When we look at a rainbow it will always have the colors from top to bottom: Red; orange; yellow; green; blue; indigo; violet If we look at these individual rings, the red ring is of course bigger than the violet ring. In addition, it's also possible to have two or even three rainbow ...
Honestly, I can't believe this hasn't already been asked, but here it is Background Given a simple undirected planar (the graph can be drawn in the plane without intersections) graph, it is a proven theorem that the graph is 4-colorable, a term we will explore in a bit. However, it's far easier to 5-color a graph, whic...
There is a job which can be decomposed into x equally-sized smaller tasks. You have a team of size y <= x, where every member works equally fast on any task. The goal for this challenge is to divide the work as evenly as possible such that every member of your team has at least 1 task to perform. As evenly as possible ...
The Onion (warning: many articles are NSFW) is a satirical news organization that parodies traditional news media. In 2014, The Onion launched ClickHole (warning: also frequently NSFW), a satirical news website that parodies "clickbait" sites like BuzzFeed. Thanks to Poe's Law, it's fairly common for people to read the...
Leonardo of Pisa (ca. 1175 - ca. 1245) is better known as Fibonacci. But this is actually a short for the Latin "filius Bonacci" (the son of Bonacci) which was made up during the 18th century (according to Wikipedia). In this challenge, you'll be given an ordinal number (in the literal sense) between 1st and 20th and y...
Introduction Given an undirected graph G, we can construct a graph L(G) (called the line graph or conjugate graph) that represents the connections between edges in G. This is done by creating a new vertex in L(G) for every edge in G and connecting these vertices if the edges they represent have a vertex in common. Here...
The powers that be want to be able to quickly convert any number they have into their own number base using any format they would like. Input Your program must accept 3 parameters. Number: The string number to be converted InputFormat: the base string the number is currently in OutputFormat: the base string that the ...
Introduction: After I posted two rainbow-related challenges: Codegolf Rainbow : Fun with Integer-Arrays 1 and Codegolf Rainbow : Draw in Black-and-White 2, the following comment was made by @ChrisM in the ASCII (Draw in Black-and-White) challenge: Maybe you know this and it's by design (I know that rainbows are not rh...
Given a positive integer, we can form a new number that's described by its digits taken pairwise (with a leading 0 added for numbers with odd number of digits). For eg.: 1234 can be read as one 2, three 4s - so, the output for 1234 is 2444. 643 has an odd number of digits, so a leading zero is added to make it even....
Background Consider the following sequence (A051935 in OEIS): Start with the term \$2\$. Find the lowest integer \$n\$ greater than \$2\$ such that \$2+n\$ is prime. Find the lowest integer \$n'\$ greater than \$n\$ such that \$2 + n + n'\$ is prime etc. A more formal definition: $$a_n=\begin{cases}2 & \text{if }n=0 ...
A number spiral is an infinite grid whose upper-left square has number 1. Here are the first five layers of the spiral: Your task is to find out the number in row y and column x. Example: Input: 2 3 Out : 8 Input: 1 1 Out : 1 Input: 4 2 Out : 15 Note: Any programming language is allowed. This is a code-golf cha...
Your goal is to write a program or function that takes in as input a string representing the path to a file, and outputs a truthy value if that file is not empty and contains no non-null bytes -- i.e., all bits are 0 -- and a falsey value otherwise. I realize it is a very simple problem and I guess I could hack somethi...
As the title may suggest, this problem is semi-inspired by the Polite Near-Sighted Drunk Bot by @N.P. Our poor bot is placed on a cartesian grid at the origin, and after each minute, it moves 1 unit in one of four directions (Up, Down, Left, Right). After n minutes, all of the latent mines on the grid activate, killin...
Given a string of text, output it as a 'tower'. Each slice of the string (of the form 0:n) is repeated 5*n times, so the first character is repeated 5 times, then the first and the second 10 times, etc. Examples: 'hello' -> ['h'] ['h'] ['h'] ['h'] ['h'] ['h', 'e'] ['h', 'e'] ['h', 'e'] ['h', 'e'] ['...
Entries are now closed. Any new entries or edits will not be counted in the final run. Join the chat! Challenge Try to fill the canvas with as much paint as possible. Be careful of other bots that may paint over your hard work though! Note: In this challenge description, paint means to change the colour of the squar...
Given an integer greater than 1, output the number of ways it can be expressed as the sum of one or more consecutive primes. Order of summands doesn't matter. A sum can consist of a single number (so the output for any prime will be at least 1.) This is code-golf. Standard rules apply. See this OEIS wiki for related i...
Given an ordered list of same-case letter strings (a-z XOR A-Z) where each string is preceded by 0 or more space ( ) characters, output the same list but with the strings sorted at each level of indentation. Indentation depths under different parents count as distinct lists for sorting purposes. Example If your input i...
When we publish some software, we assign a version number to it. And users may want to update to the latest version of some software. So, it is the time to find out which version should be newer. Input Input two version numbers as strings. In the context of this challenge, we only support version numbers which are some...
Okay, so I saw this in a meme and decided it'd be the perfect code golf challenge: I prefer to increase the side of my indents according to the Fibonacci sequence: class Kls def method t = Time.now if t.hour >= 12 puts "It's afternoon" if t.hour == 18 puts "It's time for your meal of:" %w(bre...
Given a large number (in base 10), such as 1234567891011121314151617, find prime "subnumbers" in it. A prime "subnumber" is a consecutive sequence of digits (taken from the input), which represents a prime number (in base 10). Input: A number (either a string, a file, or whatever you like). Output: All prime subnumb...
Sandbox Post Intro The information panels are everywhere. When the technology became cheaper, the paper posters were transformed into luminous signs that show words that appear on one side and come out on the other, like the one on the figure: When one of these signs starts up, it usually starts empty and the text lea...
Introduction There is a group of people that have to cross a rickety bridge that can only support two people at a time. It is a dark and foggy night, but unfortunately, the group only has one lamp. The bridge must be crossed by an individual or pair that is holding the lamp. When a pair is traveling together, they must...
Background I like my old 8-bit 6502 chip. It's even fun to solve some of the challenges here on PPCG in 6502 machine code. But some things that should be simple (like, read in data or output to stdout) are unnecessarily cumbersome to do in machine code. So there's a rough idea in my mind: Invent my own 8-bit virtual ma...
ProSet is a classic card game that is played normally with 63 cards. One card has 6 colored dots on it, like below The rest of the cards are missing some of these 6 dots, but each card has at least 1 dot. Every card in the deck is different. Below are some example valid cards. A ProSet is a nonempty set of cards such...
Gomoku or Five in a row is a board game played by two players on a \$15 \times 15\$ grid with black and white stones. Whoever is able to place \$5\$ stones in a row (horizontal, vertical or diagonal) wins the game. Rules In this KoTH we'll play the Swap2 rule, meaning that a game consists of two phases: In the initial ...
Influenced by Non-discriminating Programming, I made up an idea of a similar challenge. Here, we say a string is a Lucas string if the number of appearances of each character is a Lucas number (2, 1, 3, 4, 7, ...), and a string is a Fibonacci string if the number of appearances of each character is a Fibonacci number (...
New to code golf and enjoying it. I have a problem that I cannot figure out and am curious if others can solve it. Start with two dictionaries, y and z: y = {'a': 1, 'c': 3, 'e': 5, 'g': 7} z = {'b': 2, 'd': 4, 'f': 6, 'h': 8} y and z both map length-1 strings to numbers, where each number is between 1 and 26 (inclusi...
Inspired by this post over on Puzzling. Spoilers for that puzzle are below. Given three positive integers as input, (x, y, z), construct the inclusive range [x, y], concatenate that range together, then remove z not-necessarily-consecutive digits to produce the largest and smallest positive integers possible. Leading z...
Related Goal: Given two creatures with optional combat abilities, return unique but consistent values that represent which creatures died, if any. Input: #Longest form: [[P,T, "<abilities>"], [P,T, "<abilities>"]] #Shortest form: [[P,T], [P,T]] Each creature will be given in the form of [P,T,"<abilities>"]. It will be...
As I'm applying for some jobs whose job advert doesn't state the salary, I imagined a particularly evil interviewer that would give the candidate the possibility to decide their own salary ...by "golfing" it! So it goes simply like that: Without using numbers, write a code that outputs the annual salary you'd like to ...
task Your task is to build a structure with \$n\$ cubes. The volume of cubes follow the following sequence (bottom -> top) \$n^3, (n-1)^3, (n-2)^3,...,1^3\$ input The total volume of the structure (\$V\$). output value of (\$n\$), i.e : The total number of cubes. \$V = n^3 + (n-1)^3 + .... + 1^3\$ notes Input will a...
Given a non-negative integer, \$n\$, yield the \$(n^2)^\text{th } n\$-gonal number. Further Detail: The \$x\$-gonal numbers, or polygonal numbers, are also known as the two-dimensional figurate numbers. Many people will be familiar with the triangular numbers, these are the \$3\$-gonal numbers: $$F(3,n)=\sum_{i=1}^{n}(...
Find the runs inside an array A run is defined as three or more numbers that increment from the previous with a constant step. For example [1,2,3] would be a run with step 1, [1,3,5,7] would be a run with step 2, and [1,2,4,5] is not a run. We can express these runs by the notation i to j by s where i is the first numb...
Challenge Train a single perceptron with 2 inputs and 1 output. Step 1: Initialize the weights Step 2: Calculate the output For inputs: [i1, i2, ..., in] and weights: [w1, w2, ..., wn] the output is: i1 * w1 + i2 * w2 + ... + in * wn Step 3: Apply activation function on the output (i.e sigmoid) Step 4: Update the we...
Textbattles Textbattles is is strategy game about, well, text. It consists of a 10x10 grid, where each player has a position on the grid. When it is a player's turn, they can decide whether to move a step in any direction on the grid, or just stay where they are. If a player moves into another player's spot, they are ...
I have a colleague at work that works from home every Tuesday and Thursday. At around 8:00 AM he sends us a message with the following text: Hello today I'm working from home In order to relieve him from the burden of doing this every day he stays at home, we would like to automate this task for him. The challenge Wr...
While I was traveling in the future, I noticed a funny game among kids circa 2275. When they don't want their great-great-great-great-grand parents to understand what they're saying, they use the BIBABOBU speak. Obviously, I couldn't understand anything either with my pre-cyborg era brain and I felt (or technically: I ...
You run a political website, and have determined that people have a better intuitive understanding when the chance of winning or losing an election is expressed as a ratio ("5 in 7") than when it is expressed as a percentage ("71%"). But you also don't want to display confusing ratios like "58 in 82", you'd like them ...
Challenge Write a program or a function that returns or prints a square-random-symmetrical matrix. Input N: The size of the matrix i.e 6 x 6 Output The matrix. You can either print it, return it as string (with the newlines) or as a list/array of lists/arrays. Rules You need to use at least N different characters, ...
Challenge Giving a valid arithmetic sum with some missing numbers, output the full expression. Example: 1#3 123 + 45# => + 456 -------- -------- 579 579 Input Expression format can be an array ["1#3", "45#", "579"], a string "1#3+45#=579", or 3 inputs f...
You are writing a screen scraper application monitoring a text-only chat window. Text is added at the bottom of the window. The application takes screenshot of the chat window. If a change has occurred since last screenshot (new_screenshot != old_screenshot), the screenshot is saved. After X time, all images are merg...
The Triforce is a fictional artifact in The Legend of Zelda, made of three identical-looking equilateral triangles representing power, wisdom and courage. Several games in the saga include an animation when the three parts finally join together. The purpose of this challenge is to draw a single 2D frame of such a simpl...
Challenge Given a grid size, obstacles' positions, player position and target position your task is to find a path for the player to get to the target and avoid the obstacles at the same time (if necessary). Input N: Grid size N x N P: Player's position [playerposx, playerposy] T: Target's position [targetposx, targ...
Challenge For a given positive integer \$n\$: Repeat the following until \$n < 10\$ (until \$n\$ contains one digit). Extract the last digit. If the extracted digit is even (including 0) multiply the rest of the integer by \$2\$ and add \$1\$ ( \$2n+1\$ ). Then go back to step 1 else move to step 4. Divide the rest of...
Your task is to write a program or function that determines whether a number is divisible by another. The catch is that it should give an answer as soon as possible, even if not all digits of the number have been given. Your program should take an integer D ≥ 2 and then a series of digits as input. These represent the ...
Vowels rhyme: Apples and Bananas There is a traditional children's song that repeats the same text over and over, only each time every vowel is replaced with a random vowel, but constant across the current stanza. Challenge The objective is to propose the shortest code that performs such a transformation on an input te...
Challenge Given a number width, number height, hours and minutes print the time using the following format style: ------ - ------ ------ - - ------ ------ ------ ------ ------ | | | | | | | | | | | | | | | | | ------ ------ ------ ------ ------ | ...
Write a program which can encode text to avoid reusing characters, and convert back. Both normal and encoded forms are restricted to a particular character set: the space character with code point 32, the tilde character ~ with code point 126, and all characters between. This is 95 total characters. It's a printable s...
You will be given 3 integers as input. The inputs may or may not be different from each other. You have to output 1 if all three inputs are different from each other, and 0 if any input is repeated more than once. This is code-golf, so make your code as short as possible!
Given an N-dimensional orthogonal (non-ragged) array of non-negative integers, and an indication of which dimensions to reverse, return the array but reversed along those dimensions. The indication may be given as a Boolean list of length N or a list of a subset of the first N dimensions indexed from 0 or 1. Please sta...
I hate hashes because they remind me of hashtags, help me find them in the input Input A piece of text This is an #example text, #designed for demo #purposes, #to demonstrate the challenge.# You may add a optional newline character at the end of the input if your program requires this You may assume that there will ...
Introduction: Inspired by this comment of @MagicOctopusUrn on @Emigna's 05AB1E answer for my "It was just a bug" challenge: 8F9ÝÀNð×ý}».∊ I done did made a spaceship maw! And I was all excited about suggesting a 12-byte edit. – Magic Octopus Urn Jul 17 '17 at 20:10 Which is a 05AB1E (legacy) program resulting in this...
Imagine you have an array of integers, whose non-negative values are pointers to other positions in the same array, only that those values represent tunnels, so if the value in position A is positive and points to position B, then the value in position B must be also positive and point to position A to represent both e...
A nondeterministic finite automaton is a finite state machine where a tuple \$(state,symbol)\$ is mapped to multiple states. Ie. we replace the usual \$\delta : Q \times \Sigma \to Q\ \$ transition function of a DFA with another function \$\Delta : Q \times \Sigma \to \mathcal{P}(Q)\$. If you know what an NFA is you mi...
Definition Given a matrix \$M\$ of non-negative integers and a non-negative integer \$k\$, we define \$F_k\$ as the "chop-off" function that removes all rows and all columns in \$M\$ that contain \$k\$. Example: $$\begin{align}M=\pmatrix{\color{red}6&\color{red}1&\color{white}{\bbox[red,1pt]{5}}\\1&2&\color{red}8\\\col...
Your task is to write a non-empty computer program comprised of some sequence of bytes. If we choose a particular byte in the program and remove all instances of it from the program, the modified program should output the removed byte. For example if our program were aabacba Then bcb would output a, aaaca would need ...
A few days ago, I came up with a fun card game to play with my friends. We were having fun playing it, when I thought, "Why not make this a KoTH?" So, here it is! Overview In this game, the objective is to get the most points. Your bot starts with 0 points and 20 energy. Every turn (500 in a game), both bots play one c...
ALERT: IN CASE YOU DOUBT, NO PUN ON "QUINE" IS INTENDED In regulated horse-racing for gambling, bets called Quinella bets exist and in which a person bet on the first two places of a race. In racecourses, usually there is a display which shows the odds of a specific combination as below: (This picture is a cropped p...
It is 20th anniversary of Casio's S-VPAM calculators and it is worth celebrating. Task: Process input string as Casio S-VPAM calculator does. The infix notation and precedence of mathematical operations must be followed. Angle values are expected in radians. Since there were multiple updates, sin 15, sin15 and sin(15 a...
I noticed a certain game had a peculiar life counter, which instead of stopping at 999, gained a new digit – the next number was crown hundred or 00. After 99 came crown hundred crownty (0) and the last number, after 9, was crown hundred crownty crown or , which would be 1110 in decimal. Your task is to write a program...
Unlike many C&R challenges, this does not require a separate robbers post; the goal of the robbers is to crack the previous answer and then post a new one as a cop. As answerers, you will write a series of polyglots that look like this (each column is a language, and each entry is the output of the answer in that langu...
This challenge is based on this Stackoverflow question. With a positive number as input, output it as the sum of each digit multiplied by its power-of-10 representation. Input A number, as an integer, a string or a list of digits/characters. The number will be strictly positive. If you accept the number as a string or...
All those busy beavers made quite a mess. They wrote all over the tape. At this rate, our neighbour will stop lending us unbounded tapes. We need a new way to play the busy beaver game, one that doesn't ruin every tape we use. The Rules Brainfuck only. Memory tape is unbounded both ways. Input instruction will always r...
The Game You will be playing an (almost) standard game of Connect-4. Unfortunately, it is a correspondence game and someone has placed black tape on every second row starting from the bottom, so that you cannot see any of your opponent's moves within these rows. Any moves within already-full columns will count as passi...
Let \$n=42\$ (Input) Then divisors are : 1, 2, 3, 6, 7, 14, 21, 42 Squaring each divisor : 1, 4, 9, 36, 49, 196, 441, 1764 Taking sum (adding) : 2500 Since \$50\times 50=2500\$ therefore we return a truthy value. If it is not a perfect square, return a falsy value. Examples : 42 ---> true 1 ---> true 246 ---> true 1...
The Dihedral group \$D_3\$ represents the symmetries of an equilateral triangle, using the identity (represented by id), rotations (represented by r1 and r2), and reflections (represented by s0, s1, and s2). Your task is to compute the composition \$yx\$ of the elements \$x, y \in D_3 \$. They are given by the Cayley ...
Introduction: I think everyone knows what a Lava Lamp is, but in case they do not: (Image source) They're basically glass tubes that contain wax in a translucent liquid. The bottom part is heated when the lamp is turned on, causing a change in density and thus the wax floats to the top. When it cools down, it falls do...
Reversible computation refers to computation in which little or no information is deleted. Reversible computation a major component of quantum computation, and reversible computation is potentially many times more energy efficient than conventional computation. I want to know how easy it is to compute the conjugacy of ...
A shape is chiral if no amount of rotation can make it look like it's mirror image. In this puzzle we will be writing chiral computer programs. For this puzzle we will think of a program as a rectangular matrix of characters. As such all solutions to this challenge must be rectangular (that is all lines must be of th...
My colleague recently sent me the following piece of JavaScript as a joke: let butScript = (nrOfButs) => { for(var i = 0; i < nrOfButs; i++){ if(i % 3 == 0){ console.log("Yeah") } if(i % 2 == 0){ console.log("But") } if(i % 3 == 1){ console...
Given a 2D array of integers, let's sort its rows and columns in blocks. This means that you only have to sort a given row or column, but applying the transformations needed for sorting it to every other row or column in the 2D array. Rules Input will be a 2D array of integers and a 1-indexed integer. This integer wil...
NOTE: The winner of this competition is Jack!!!. No more submissions will be accepted. Here is the chat room for this king-of-the-hill challenge. This is my first one so I'm open to suggestions! Reaper is a game concept developed by the Art of Problem Solving which involves patience and greed. After modifying the game ...
ASCII art is fun. Modern text editors are very good at manipulating text. Are modern programming languages up to the task? One common task in ASCII art manipulation is to crop text to a rectangle between two characters. This is the task you must implement in this challenge. Details Your program will take 3 inputs: t...
An isolated character is a character (other than a newline) that doesn't have an adjacent character of the same type. Adjacent characters can be to the left, the right above or below, but not diagonals. For example in the following text H is isolated: Ybb YH% %%%% All the other characters are not isolated because ea...
Consider the following number sequence: \$ 0, \frac{1}{2}, \frac{1}{4}, \frac{3}{4}, \frac{1}{8}, \frac{3}{8}, \frac{5}{8}, \frac{7}{8}, \frac{1}{16}, \frac{3}{16}, \frac{5}{16}, \frac{7}{16}, \frac{9}{16}, \frac{11}{16}, \frac{13}{16}, \frac{15}{16}, \frac{1}{32}, \frac{3}{32}, \frac{5}{32}, \dots \$ It enumerates a...
Create a bot to choose the smallest unique number. (Based on a psychology experiment I heard about many years ago but haven't been able to track down again.) Rules Each game will consist of 10 randomly selected bots playing 1000 rounds. Each round, all bots select an integer from 1 to 10 (inclusive). Any bots that ch...
Consider this file path: C:/Users/Martin/Desktop/BackupFiles/PC1/images/cars/new.png Your goal is to write a program that will return the file path starting from the folder after the last folder that contains a number till the filename. So, for the above file path, the program should return images/cars/new.png. One or...
This is the cops' thread, the robbers' thread is here A polyglot is a program, that without modification, can run in multiple languages. Allowed languages Any language that was made before the challenge and isn't made for the purpose of the challenge, it is allowed, though discouraged, to use languages that are easy t...
This is the robbers' thread, the cops' thread is here A polyglot is a program, that without modification, can run in multiple languages. Robbers' Challenge First, find a vulnerable cop's answer, then try to find languages that the submission works in, if you found any that weren't listed by the cop, then you just cra...