instruction
stringlengths
34
53.1k
Given a positive integer n (Example: n=1234444999) Separate into consecutive digit runs: [1, 2, 3, 4444, 999] Take the digital product of each run. [1, 2, 3, 4*4*4*4, 9*9*9] = [1, 2, 3, 256, 729] Sum it... 991 Repeat until this converges to a single number: 1234444999 991 82 10 1 Return last number. Test...
Write 3 programs that do the following task: Let A, B, C source codes of those three programs; if A runs BC is produced as output, if B runs CA is produced, if C runs AB is produced; so each program writes a string (cycled for each program) and hides itself from it. Additional, but essential constraints: standard lo...
Note: This is related to a variation of the game Rummikub Background & Rules Rummikub is a tile-based game. There are four colors: red, orange, blue and black. For each color there are 13 tiles (labeled from 1 to 13), and there are also 2 Jokers which are color-independent, hence there are 54 pieces in total. In this ...
Probably a simple code-golf challenge. Given 2 positive integers m and n, make a list of n values that are positive integers whose sum is equal to the number m. Either all values in the output are the same value or the difference is exactly 1. Examples For example m=6 and n=3 would become 2, 2, 2 m=7 and n=3 would bec...
Let's define a sequence of positive integers. We will define the value of the sequence at every even index to be double the previous term. The odd indices of the sequence will be smallest positive integer not yet appearing in the sequence. Here are the first couple terms. 1,2,3,6,4,8,5,10,7,14,9,18,11,22,12,24,13,26,...
Background Python 3 has many types of string literals. For example, the string this 'is' an exa\\m/ple can be represented as: 'this \'is\' an exa\\\\m/ple' "this 'is' an exa\\\\m/ple" r"this 'is' an exa\\m/ple" '''this 'is' an exa\\\\m/ple''' """this 'is' an exa\\\\m/ple""" r'''this 'is' an exa\\m/ple''' r"""this 'is' ...
A Gaussian integer is a complex number whose real and imaginary parts are integers. Gaussian integers, like ordinary integers, can be represented as a product of Gaussian primes, in a unique manner. The challenge here is to calculate the prime constituents of a given Gaussian integer. Input: a Gaussian integer, which i...
A slightly more challenging one compared to my previous challenge. Given a list of positive integers (>0) and the positive integer m, output a list of positive integers that are capped values of the input values so that the sum of the capped values equals m. Cap the highest values first. And keep the same order. Cases ...
Inspired by github.com/JackToaster/Reassuring-Parable-Generator, in turn inspired by xkcd.com/1263. The possible words are derived from the reassuring.cfg of that repository. Having a look at the reassuring.cfg (use the 12th commit) is suggested to see the grammar the output matches (The output is a list of all strings...
The task is to write code to identify which key is pressed on the keyboard. You can assume that only one key is pressed at a time and that there is a standard US keyboard layout. That is the layout with the @ over the 2. Your code should output a unique identifier for any key pressed. This includes PrtScn, Scroll Lock,...
An integer is binary-heavy if its binary representation contains more 1s than 0s while ignoring leading zeroes. For example 1 is binary-heavy, as its binary representation is simply 1, however 4 is not binary heavy, as its binary representation is 100. In the event of a tie (for example 2, with a binary representation ...
The first two MU-numbers are 2 and 3. Every other MU-number is the smallest number not yet appeared that can be expressed as the product of two earlier distinct MU-numbers in exactly one way. Here are the first 10 2, 3, 6, 12, 18, 24, 48, 54, 96, 162 Task Given a positive number calculate and output the nth MU-number...
There are lots of challenges that just pick a sequence from oeis and ask you to print n-th number or first n numbers or whatever. It's time to stop automate! Task Your task is to parse a sequence page from oeis.org and print its index, description and example values. The page's index should be chosen and random, sele...
Title stolen inspired by Greg Hewgill's answer to What's the difference between JavaScript and Java? Introduction Java and JavaScript are commonly used languages among programmers, and are currently the most popular tags on Stack Overflow. Yet aside from similar names, the two have almost nothing in common. In honor of...
Imagine a histogram. Pour an infinite amount of water on to it. Then stop. How much water does the histogram hold? Let's say we have a histogram with columns of these heights: 1 3 2 1 4 1 3 That would look like this: # # # # ## # # ####### 1321413 If we pour an infinite amount of water on this histogram, some ...
Write a program or function to produce the following output in the correct order. EDIT: The symbols are not mathematical! The numbers just represent unique data and the + and - could be any two arbitrary symbols. Take an non-negative integer input n. The first line is always -, even for n=0. If the current line is -, ...
Background I play D&D on a regular basis with some friends. While talking about the complexity of some systems/versions when it comes to rolling dice and applying bonuses and penalties, we jokingly came up with some additional complexity for dice rolling expressions. Some of them were too outrageous (like extending sim...
Seahorses, of course, need shoes. However, a seahorse, having just one tail, needs just one shoe. Unfortunately, the shoes only come in pairs. Money is tight for the seahorse government, so they need to buy as few pairs as possible. Each seahorse has a shoe size x where x is a positive integer. However, a seahorse can ...
A Bell number (OEIS A000110) is the number of ways to partition a set of n labeled (distinct) elements. The 0th Bell number is defined as 1. Let's look at some examples (I use brackets to denote the subsets and braces for the partitions): 1: {1} 2: {[1,2]}, {[1],[2]} 3: {[1,2,3]}, {[1,2],[3]}, {[1,3],[2]}, {[2,3],[1]}...
As everyone knows, adding inator-3000 to the end of any noun makes it way cooler. But what else can make a word cooler? Given an ASCII string as input, output the coolness of the word. Calculating the coolness There are 4 elements to calculating the coolness of a word. The word itself. The base score is the number of ...
Task Given an input, evaluate it as a mathematical equation following the order of operations. But, instead of the using PEMDAS, we drop the parentheses and exponentiation and introduce spaces - SMDAS - spaces, then multiplication & division, then addition & subtraction. How does that work? Every operator with more spa...
ASCII reflections in a box You probably all know the Law of Reflection, in this challenge you'll visualize the trajectory of a ball in a box. Related: ASCII Ball in Box Animation and ASCII Doodling: Laser in a Box Task You're given three integer pairs W,H, x,y and dx,dy - the first represents the size of the box, the s...
There are one hundred members of the United States Senate. Assuming that nobody filibusters and that the Vice President isn't cooperating, at least fifty-one members are necessary to pass a bill. But some members work together better than others, entropy-wise. Your task: Output the last names of at least 51 of the US s...
Given an array of positive integers, output an array of all the elements that are greater than or equal to the adjacent ones. Most elements will have two adjacent elements; the first and last element are special cases, as they only have one adjacent element. You may assume that the array contains at least two elements....
For this challenge you are going to make a function (your function may be a complete program) that takes a list as input and returns a permutation of that list. Your function must obey the following requirements. It must be deterministic. Composing your function with itself a variable number of times should be capabl...
Challenge closed, the shortest answer has been acccepted. A military projection is a projection where all lengths and the angles in the X-Z plane remain unattuned. Your task is to print a cube in military projection using /, |, \, -, and any whitespaces you want, given any integer greater than zero as it's side length....
You love lunch. However, you are on a diet and want to make sure you don't accidentally eat lunch twice in one day. So you need to make a program to help you make sure. However, one complication is that you eat lunch on a very weird schedule. The time you eat lunch at is MONTH:DAY PM (you can use UTC or localized time ...
It is widely known that Santa Claus delivers presents to houses all over the world in December. However, not many people know what he does during the rest of the year. You see, Santa enjoys a jolly good prank, and he'll often find himself pranking entire cities when he's not busy making or delivering toys. One place t...
Inspired from a real problem; we were looking at this table and said "Hey, now that's a good codegolf problem." The KOOS Jr. scores converts from a raw number to a percentile score given this table: Raw summed score Interval score (0-28) (0 to 100 scale) 0 100.000 1 91.975 ...
You will be given a positive integer as input. The integer is the board of a seesaw. Th integer will not have leading zeroes. You may take this input however you like. Your task is to output the location of the pivot point of this seesaw, such that the board would balance. A board balances if the moments on each side a...
Your task is to make a program that prints out its own source. "Hey, we already have this challenge, and tons of variations of it! Why are you making another one?" you may ask, but this one is going to be one of the most difficult ones (hopefully, anyway). Your quine must be "mutation-hardened", which means the quine, ...
For the question Find the highest unique digit , here is my answer : 9A,sqfe=W%X#- At the end I am essentially trying to achieve a lastIndexOf. I do that by reversing my array, using indexOf, and subtracting from 9. This adds 4 (9 W % -) extra bytes to get from indexOf to lastIndexOf. Furthermore, if I didn't know my...
Your task, if you wish to accept it, is to write a program that outputs a positive integer (higher than 0). The tricky part is that if I duplicate your source code, the output must be double the original integer. Rules You must build a full program. That is, your output has to be printed to STDOUT. The initial source...
This is a variant of Play the word chain and Building a long chain of words . The input is a non-empty list of unique words at least 2 chars long made of characters in [a-z]. You need to output the length of the longest possible chain, where each subsequent word starts with the last letter of the previous word. You ca...
Lets take a set of integers greater than 1 and call it X. We will define S(i) to be the set of all members of X divisible by i where i > 1. Would like to choose from these subsets a group of sets such that Their union is the set X No element of X is in two of the sets. For example we can regroup {3..11} as ...
You have given an array from which we need to remove duplicates. Rules: First or immediate duplicates gets removed first. Array contains natural numbers a[i]>0 for i>=0 no. of elements in the array is greater than 1 i.e. n>1 e.g. {1,2,3,4,5,5,4,6,6,7,8}=> {1,2,3,7,8} {1,2,3,3,4,5,6,7,7,8} => {1,2,4,5,6,8} {1,1,3,3,...
Description I guess everyone knows the fairy tale of Rapunzel and the prince. For those who do not: read it here. However, Rapunzel had just had her hair cut, so it might not be long enough to let her prince climb up! She may get very sad.. Challenge Your task is to write a function that evaluates what Rapunzel will be...
Inspired (like 2 others) by this chat message. (and to some extent, my CMC) Given a string as an input, your task is to check whether or not that string is a number. What is a number? This is a list of all input formats that are "numbers": Integers: An integer is a string made entirely of characters from 1234567890, w...
The graph of the modulo operation (\$y = x \mod k\$) looks like this: This is a very useful function, as it allows us to create "wrapping" behavior. However, it is very cumbersome when I want to use it to create an appearance of "bouncing" between two walls. The graph of the "bounce" function (\$y = \text{bounce} (x, ...
Background Sometimes, people think you didn't work at your git project. But - you can prove yourself with git shortlog -n. Now, the problem is you are a programmer and programmers are lazy. So you want to write a program which shows the person who committed at most. Rules You may not do the following things: use git s...
Don't you hate it when you can't remember how to craft something in Minecraft? Well, time to remedy that! Task Your task is to take an input, either as a 1D or 2D list and output what item is a result of the crafting table! Input You may take input as either a string or a list of length 9 or a 2D nested array. If you t...
Description Chicken McNugget numbers are numbers that can be expressed as a sum of \$6\$, \$9\$ or \$20\$ - the initial sizes of the famous Chicken McNuggets boxes sold by McDonald's. In that sum, a number may occur more than once, so \$6 + 6 = 12\$ is such a number too, and the number must "contain" at least one of th...
The RGB color value #00FF00 is a rather important one: it is used to make movies, TV shows, weather announcements, and more. It is the famous "TV green" or "green screen" color. The Challenge Your task is to write a program that takes two input images, both in PNG format (or in your image library's image object type) a...
Inspiration: Heavily inspired by Smallest chess board compression I decided to make a similar but distinctly different competition. tl;dr Take the file Chess_Games.txt and compress it as much as you can so that you can expand it to the original file. Objective: Write an algorithm to encode and decode an entire chess da...
Your challenge is to output a Base64-encoded version of your source code, and optionally a line break. You must output the correct padding, if any. Standard quine rules apply, shortest answer wins. It must be a valid RFC 4648 encoded base64 string, with no linebreaks (except optionally a trailing newline). Test cases: ...
From the wikipedia: Net neutrality is the principle that Internet service providers and governments regulating the Internet should treat all data on the Internet the same, not discriminating or charging differentially by user, content, website, platform, application, type of attached equipment, or mode of communicatio...
In this challenge you have to make an ascii pulsing heart with rhythm problems (Heart arrhythmia) and then measure the pulse.Don't worry it's easy! Making the heart The heart alternates between these 2 states: state 1 ,d88b.d88b, 88888888888 `Y8888888Y' `Y888Y' `Y' state 2 d8b d8b ...
If you are not familiar with Braid-Theory I recommend that you read this first. This question assumes that you are at least familiar with the concepts at hand and assumes you are well familiar with group-theory Let us define \$\sigma_n\$ to be the braid in which the \$n\$th strand (One indexed) from the top crosses ...
Guidelines Task Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array (lists in some languages). Rules This is code golf so the shortest answer in bytes wins! You will always get a valid array There will always be exactly one letter missing Th...
Based on this challenge. In the rhythm game osu!, the difficulty modifier "Double-time" actually only increases the speed by 50%. Your task, is to write a program that outputs a positive even integer (higher than 0), and when each byte/character (your choice which) in your source code is duplicated, it should output th...
Description There have been quite a few other challenges concerning these numbers before, and I hope this one is not among them. The n th triangular number equals the sum of all natural numbers up to n, simple stuff. There are a wikipedia page and an entry at OEIS, for those who wish to inform themselves further. Now, ...
Help! I just logged into Stack Exchange, but I forgot what my password is! I need a way to work it out before I log off. Luckily, I'm an excellent hacker. Not only was I able to find my password's hash, but I also found Stack Exchange's hashing algorithm! It takes the ASCII value of each digit multiplied by that digit...
We define a prime character as a character that has a prime ASCII value. We define a prime string as a String that only contains prime characters. Given a String that only contains printable ASCII, determine whether that String is prime. Input / Output You can take input either as a String or as a list of individual c...
Let's see how good your language of choice is at selective randomness. Given 4 characters, A, B, C, and D, or a string of 4 characters ABCD as input, output one of the characters with the following probabilities: A should have a 1/8 (12.5%) chance to be chosen B should have a 3/8 (37.5%) chance to be chosen C should h...
Challenge Given an integer in 32-bit two's complement format, return the index of the second least-significant zero digit in the binary representation, where an index of 0 represents the least significant bit, and an index of 31 represents the most significant bit. If there is no second zero, you may return 0, any nega...
Description We consider an integer with at least 3 digits triple-balanced if, when split into three parts, the digits in every part sum up to the same number. We split numbers as follows: abcdefghi - Standard case: the number of digits is divisable through 3: abc def ghi abcdefgh - Number % 3 == 2: The outer groups ar...
As we all know, it's turtles all the way down. But is it primes all the way down too? A number is considered a "turtle-prime" if it satisfies the following conditions: 1) It is prime. 2) It is possible to remove a single digit leaving a prime number. 3) Step 2 can be repeated until left with a single digit prime. For ...
Many of us are familiar with the game Tron. You control a "lightcycle" placed on a grid. The lightcycle always moves forward (though you control the direction) and leaves a permanent trail behind it. If you run into a trail, you crash! The goal here is to determine if a given path is a valid loop, that is, it returns t...
I noticed that there's no such question, so here it is: Do you have general tips for golfing in x86/x64 machine code? If the tip only applies to a certain environment or calling convention, please specify that in your answer. Please only one tip per answer (see here).
One problem on a website like this is that you often don't know if you are talking to a male or female. However, you have come up with a simple NLP technique you can use to determine the gender of the writer of a piece of text. Theory About 38.1% of letters used in English are vowels [a,e,i,o,u] (see References below, ...
Given a non-negative integer or a list of digits, determine in how many ways can the number be formed by concatenating square numbers, which may have leading zeroes. Examples input -> output # explanation 164 -> 2 # [16, 4], [1, 64] 101 -> 2 # [1, 01], [1, 0, 1] 100 -> 3 # [100], [1, 00], [1, 0, 0] 1 -> 1 # [1] 0 -> 1 ...
The infinity symbol is also called a lemniscate. Your program must draw a lemniscate with text via standard out (formatted with newline feeds) or graphically. The infinity symbol (by my standards) must be continuous (that is, every non-whitespace character must be touching two other non-whitespace characters diagonally...
Problem Given input a where a is a grid of characters in any input format as long as it has only one element for each 'block' of the output. And input b where b is a grid of numbers the same size as input a. There are two types of road, a 1 represents a stone road marked by @ and a 2 represents a dirt road marked by # ...
Description A Caesar Shift is a very simple monoalphabetic cipher where each letter gets replaced by the one after it in the alphabet. Example: Hello world! -> IFMMP XPSME! (IBSLR, EGUFV! is the output for the actual challenge, this was an example of shifting by 1.) As you can see, spacing and punctuation remain unatt...
Drunk Uncle (sorry M.E. and AUS for region lock) is a fictional character from Saturday Night Live. He often confuses words for others that sound like them. For this challenge you need to convert normal speech into drunkspeak. Algorithm Translating to drunkspeak requires swapping the order of words in the text. Swappin...
There is a Sioux village. It has a totem: __ ___| |___ \/ \ / \/ /\ ``| |`` /\ /^^\ | | /^^\ / /\ \ | | / /\ \ '''''''''''''''''''''''''''' The totem lets the Sioux mastering the weather for helping in their different tasks. Help the villagers p...
I'm honestly surprised that this hasn't been done already. If you can find an existing thread, by all means mark this as a duplicate or let me know. Input Your input is in the form of any positive integer greater than or equal to 1. Output You must output the sum of all integers between and including 1 and the number i...
These are the hosts of the "Weekend Update" news segment on Saturday Night Live, with the years they hosted and their initials: Chevy Chase 1975-1976 CC Jane Curtain 1976-1980 JC Dan Aykroyd 1977-1978 DA Bill Murray 1978-1980 BM Charles Rocket 1980-1981 CR Gail Matthius 19...
To "shift" over a number n places, do the following: Remove the last n digits Add n copies of the first digit to the beginning of the number For example, to shift the number 31415 three places, take out the last three digits to get 31, and then add three more copies of the first digit, 3, to the end, giving 33331. If...
This is a tips question for golfing in Python, which is on topic for main. I'm looking for the shortest way to get all of the most common elements of a list in Python, in the shortest way possible. Here's what I've tried, assuming the list is in a variable called l: from statistics import* mode(l) This throws an error...
Inspired by this comment... Thanks to users Step Hen, Wheat-Wizard, and Dennis for helping my solidify the specification of this challenge before posting it! This is the Cops' thread. For the Robbers' thread, go here In this challenge, you are tasked with running some code that makes it so that your language no longer...
Inspired by this comment... Thanks to users Step Hen, Wheat-Wizard, and Dennis for helping my solidify the specification of this challenge before posting it! This is the Robber's thread! For the Cops' thread, go here In this challenge, you are tasked with running some code that makes it so that your language no longer...
Introduction Classically, booleans are one bit; true or false, 1 or 0. Leading zeros would just be redundant. For example, 001 means the same as 00001 or just 1. The 32-bit boolean Given a truthy/falsey value, output the equivalent 32-bit boolean as a string. (Or as a number if for some reason your language supports l...
Simple challenge: try to output the following text in as few bytes as you can: the answer toli fetheuniv ersea nde ver ything the ans wer tol ife the uni ver sean dev ery thin gth ean swer tolifetheuni ver seandeveryth in...
Problem Build an octal calculator that can do the following operations: Add (+) Subtract (-) Multiply (*) Divide (/) Check is prime Counting in octal is like this with decimal (Octal) (Decimal) 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 10 8 11 9 and so on.....
I need to call my friends but the buttons of my cordless phone are not working properly. The only buttons I can press are [Up], [Down] and [Call]. [Up] and [Down] can be used to navigate in my recent calls and [Call] can be used to call the selected name. My phone has a list that holds N recent calls, and I know that a...
We are all familiar with the famous Fibonacci sequence, that starts with 0 and 1, and each element is the sum of the previous two. Here are the first few terms (OEIS A000045): 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584 Given a positive integer, return the closest number of the Fibona...
Basic rules (different from mine) Story It is the year 4579, humans now have 2 hands with 1001 fingers each. Chopsticks has become based off of points. And @Dennis has more rep then @Martin... Hand drawn red circles are now downvoted... Jon Skeet has hit 2 trillion rep on every SE site... Yeah scary I know Chopsticks i...
(based on this post and the ensuing discussion on chat -- also, much thanks to Dennis for TIO!) The Challenge Choose a language that's currently available on the TryItOnline site, for example PowerShell. Write code in that language on that page, that doesn't take any input, such that when the Run button is clicked, the...
Let's say you have some text, and you want it to send it to your friend, but you don't want anyone else to read it. That probably means you want to encrypt it so that only you and your friend can read it. But, there is a problem: you and your friend forgot to agree on an encryption method, so if you send them a messa...
Description: A non-integer representation of a number uses non-integer numbers as the bases of a positional numbering system. e.g. Using the golden ratio (the irrational number 1 + √5/2 ≈ 1.61803399 symbolized by the Greek letter φ) as its base, the numbers 1 to 10 can be written: Decimal Powers of φ Base φ...
Challenge Take a number and output it with 4 digits or less using letters and numbers. For example; 270,030 would turn into 270K. Key Billion -> B Million -> M Thousand -> K Rules You may choose to accept input numbers that include commas delimiting every three decimal places (such as 123,456,789). Round to nearest, h...
The challenge is to find a string of characters that cannot appear in any legal program in your programming language of choice. That includes comments, strings, or other "non-executable" parts. Challenge Your program may be specific to a particular version or implementation of your language's compiler/interpreter/runt...
Goal Given an input number, round it off to the nearest number with one significant figure. Requirements Input A floating point number. Assume the input number results in an output within the data type's limits (ie. ignore overflow errors.) 0 is an invalid input. Numbers that cannot be accurately represented in the fl...
Write a function that takes a string of letters and spaces (no need to handle non-letters) and performs the ANNOUNCER VOICE translation algorithm as follows: First, uppercase everything. For each word, Elongate each consonant cluster by tripling each letter; except, if the word begins with a consonant cluster, do no...
Using the following length-separated lists of words: https://github.com/Magic Octopus Urn/wordListsByLength Print 1 word from each list of length n from 1 all the way up to 20, here's a valid example: a an and hand hands handle handles abandons abandoned understand outstanding newfoundland understanding characteristic...
Let's say we have a n × n lattice; we can then divide the lattice into two sections by drawing a line through the lattice. Everything to one side of the line is in one set and everything else in another. How many ways can we divide the lattice in the manner? For example lets take a 2 × 2 lattice: . . . . We can make ...
Thanks to HyperNeutrino for making more test cases Often in chat, someone will ask a question, and multiple people will answer it at the same time. Usually, the person who was beaten to the gun will say "ninja'd", creating even more unnecessary chat. Given a chat log similar to the following: Community: Hi Test: Hi Ran...
According to me, a tornado looks like this: ######## ####### ###### ##### #### ### ## # This tornado starts out with width n, and on each next line, a character is removed from either the left or the right, depending on the input. Input The input will be a list of some sort of any two unique values (...
There have been a billion iterations of Fibonacci challenges on this website, so lets spice things up with a Fibonacci challenge of a billion iterations! Your challenge is to output the first 1000 decimal digits of the 1,000,000,000th Fibonacci number with as short a program as possible. This may then optionally be fol...
In my answer, I have this code: s.match(/[AEIOU]/) This seems too verbose to check if a string is one of A, E, I, O, or U. I tried: "AEIOU".includes(s) But that's 1 byte longer. Can I do this in a shorter way?
Imagine a straight river and a road that goes across the river n times through bridges. The road does not loop on itself and is infinitely long. This road would be considered an open meander. An open meander is an open curve, that does not intersect itself and extends infinitely at both ends, which intersects a line n ...
The Challenge Your task is to create a program that takes any given string input, and outputs the input in a squared format. Empty strings should return an empty string. Examples Given the input: golf Your program should output: golf o l l o flog Input: 123 Output: 123 2 2 321 Input: a Output: a Input: Hello, w...
No, not that thing in powerpoint You will be given a string, and a 2D array of boolean values. The 2D array will represent a picture. You will be creating art out of it. Let me show you how. The steps to art First, you create a square which fits the 2d array, with the string. Like if the string is 'PPCG', and the pic...
This is similar to Making an acronym, but there are several key differences, including the method of fetching the acronym, and this challenge including flexible output. Task Given a string (list of chars/length 1 strings is allowed) containing only printable ASCII, output all capital letters in the input that are eithe...
(Despite 60+ questions tagged chess, we don't have a simple n-queens challenge.) In chess, the N-Queens Puzzle is described as follows: Given an n x n chessboard and n queens, arrange the queens onto the chessboard so that no two queens are threatening each other. Below is an example solution for n = 8, borrowed from W...
Let us define a sequence. We will say that \$a(n)\$ is the smallest number, \$x\$, that has the following properties: \$x\$ and \$n\$ are co-prime (they share no factor) \$x\$ does not appear earlier in the sequence \$|n - x| > 1\$ Unlike most sequences the domain and range of our sequence are the integers greater t...
As of 13/03/2018 16:45 UTC, the winner is answer #345, by Khuldraeseth na'Barya. This means the contest is officially over, but feel free to continue posting answers, just so long as they follow the rules. As well, just a quick shout out to the top three answerers in terms of numbers of answers: 1. NieDzejkob - 41 ans...
Inspired by this challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. How does it work? Given two strings (for example split and isbn) you will first, truncate the longer one such that they have equal length a...
Cubically is too tedious to manually write any code in. Your challenge is to translate ASCII text into Cubically source code. Cubically This is just a quick run-down of Cubically; the repository has a more complete guide and details. Cubically is an esolang I wrote a while ago, designed to be painful to use. It contain...