instruction_seed
stringlengths
34
53.1k
_source
stringclasses
1 value
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...
stackexchange_codegolf
You're tasked with writing an algorithm to efficiently estimate cost of solving an Eni-Puzzle from a scrambled state as follows: You're given m lists of containing n elements each(representing the rows of the puzzle). The elements are numbers between 0 and n-1 inclusive (representing the colors of tiles). There are exa...
stackexchange_codegolf
A binary multiple of a positive integer k is a positive integer n such that n is written only with 0s and 1s in base 10 and n is a multiple of k. For example, 111111 is a binary multiple of 3. It is easy to show that a positive integer has infinitely many binary multiples. See here for a construction proof of one binar...
stackexchange_codegolf
Closely related: How high can you count? Challenge In your programming language of choice, write as many different identity programs/functions as possible, under the following constraints: Each program should be a function or full program that is one of the following: A function that takes a single positive integer ...
stackexchange_codegolf
Now, we all know most languages have very simple ways to "self-modify" code. However, what if you were to actually modify the code and edit parts of it...on disk? Your goal is to make code that prints a number, then edits its own file to replace the number with the next one in the Fibonacci sequence like so: $ ./progr...
stackexchange_codegolf
Task Given a letter (A, B, C), and a number (0-10), output the size of the matching standard paper size (Series A and B) or the matching standard envelope size (C series) in millimetres in the format aaaa x bbbb where aaaa and bbbb are the width and height measurements in millimetres as per ISO216 (Series A & B) or ISO...
stackexchange_codegolf
Description : Given an input (a string , array , integer) , Your job is to append one of the following to it. st , nd , rd , th . Examples : 1 ---> 1st 2 ---> 2nd 3 ---> 3rd 4 ---> 4th 11 ---> 11th 12 ---> 12th 13 ---> 13th 14 ---> 14th and so on and so forth This is code golf so shortest code will win in each langua...
stackexchange_codegolf
Let's say you have a sentence like: this is a very long sentence with several words of no significance It contains only the 26 lowercase letters of the alphabet and spaces. And you have a dictionary, where each word contains any number of the 26 lowercase letters and nothing else: henge renton Then the output should ...
stackexchange_codegolf
You have your very heavy cubical box on a flat floor at position (0,0). All you can do with it is roll it in four cardinal directions (east, north, west, south). Your task is to bring it to a target position, such that the side facing up is the same as before your manipulations. Make a program or function which receive...
stackexchange_codegolf
What general tips do you have for golfing in Chef? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Chef (e.g. "remove unnecessary whitespace" is not an answer). Please post one tip per answer.
stackexchange_codegolf
Task Write a function/program that, given three positive integers a, b and c, prints a Truthy value if a triangle (any triangle) could have side lengths a, b and c and outputs a Falsy value otherwise. Input Three positive integers in any sensible format, for example: three distinct function arguments, f(2, 3, 5) a lis...
stackexchange_codegolf
Briefing Aliens have settled on earth and strangely enough, their alphabet is the exact same as ours. Their language is also very similar to ours with some very distinct and easy to compute differences. Challenge Take a string and output the alien's language equivalent. The translation works as such: Swap all the vowel...
stackexchange_codegolf
Challenge Given any positive integer supported by your language: Take the input and divide it into two halves. For all divisions in this program, if the input is odd, round one half up and one half down (ex: 7 -> 3,4, not 7 -> 3.5,3.5). Divide either number in half, then take the larger of these two new halves and add...
stackexchange_codegolf
You are an employee of Microteque, a leading Silicon Valley startup creating smart microwave ovens for all kinds of strange places. Your customers can get their microwaves printed with patterns to match their kitchens, campers, man caves; even the kitchens of large nation-state facilities have shiny new branded microwa...
stackexchange_codegolf
Specification Write the shortest possible code in any language that does the following: It takes two arguments, x and y, and generates x + y lines of text. The first x lines should consist of y nested pairs of square brackets separated by a space surrounding a single digit, which cycles from 1 to 9, then 0 to 9, etc. f...
stackexchange_codegolf
This challenge was posted as part of the April 2018 LotM challenge, as well as for Brain-flak's 2nd birthday I was thinking about what the most efficient way to encode brain-flak programs would be. The obvious thing to do, since there are only 8 valid characters, is to map each character to a 3-bit sequence. This is c...
stackexchange_codegolf
Your task is to write a program that calculates the amount of different ways to display any given whole positive number using the following rules: Meet the 'advanced binary system': Any whole positive number can be displayed in binary form, but each bit can have every number from 0 to 9. This means, a valid number migh...
stackexchange_codegolf
Background A checkered tiling of a rectangular grid is a tiling using some polyominoes, where each region can be colored either black or white so that no two polyominoes sharing an edge has the same color. In graph-theoretic terms, the chromatic number of the adjacency graph is 2. Terminology adapted from a Fillomino v...
stackexchange_codegolf
Write a program to calculate the first 500 digits of the mathematical constant e, meeting the rules below: It cannot include "e", "math.e" or similar e constants, nor may it call a library function to calculate e. It must execute in a reasonable time (under 1 minute) on a modern computer. The digits are to include the...
stackexchange_codegolf
Related: Is this quadrilateral cyclic? Background A tangential quadrilateral is a quadrilateral which has an incircle: Examples include any square, rhombus, or a kite-like shape. Rectangles or parallelograms in general are not tangential. Task Given the four vertices of a quadrilateral (as Cartesian coordinates), dete...
stackexchange_codegolf
The task is to make a function which returns random number, no build in functions allowed, returned value should be random or pseudo-random and no sequence allowed, no matter what the formula is and how scattered values are. To simplify task, returned value should be 32-bit integer or float from range [0; 1) It is code...
stackexchange_codegolf
Introduction Briscola is one of Italy's most popular card games. It is a trick-taking card game, like Bridge. Briscola is well known for its bizarre point system. In this challenge, given two cards, you will output whether the first one scores more, less, or the same number of points as the second in Briscola's point s...
stackexchange_codegolf
@BeastlyGerbil presents, the world's very first MOBIUS SUDOKU: Google Sheets version (The left most square backs onto the right most square, and the middle squares back onto each other. The ends are then attached as indicated.) RULES: Normal sudoku rules apply for rows and boxes - boxes are split into groups of 3...
stackexchange_codegolf
Gimbap(김밥) is Korean food, somewhat looks like sushi roll. Here is Korean emoticon represent Gimbap : @)))))))))) Your quest is make ASCII Gimbap cutter. Rule Input is string made with only @ and ). Output cuts every valid Gimbap with ), and then add @ between them. So for example @)) to @) @). Valid Gimbap starts wi...
stackexchange_codegolf
Given an input of an ASCII art picture, output the ASCII art italicized. To italicize the ASCII art: Insert zero spaces before the last line, one space before the second-last line, two spaces before the third-last line, etc. Remove any extra leading whitespace that may have been created. That is, if each line has at l...
stackexchange_codegolf
The task is simple: given a 32 bit integer, convert it to its floating point value as defined by the IEEE 754 (32-bit) standard. To put it another way, interpret the integer as the bit-pattern of an IEEE binary32 single-precision float and output the numeric value it represents. IEEE 754 single precision Here is a conv...
stackexchange_codegolf
If you've ever played Spacewar!, you know it was a fun game. If you haven't, know this: it was (and is) one of the very first and most important computer games. And it's still fun! The clone I grew up on is this one, which is, apparently and unfortunately, Windows only. So I recreated it! The KotH is hosted here: PPCG...
stackexchange_codegolf
Related OEIS sequence: A008867 Truncated triangular number A common property of triangular numbers is that they can be arranged in a triangle. For instance, take 21 and arrange into a triangle of os: o o o o o o o o o o o o o o o o o o o o o Let's define a "truncation:" cutting triangles of the same s...
stackexchange_codegolf
I wrote a code that separates the numbers from 1 to 9999 by comma void p(n){printf("%d,",n);if(n<9999){p(n+1);}}main(){p(1);} Is there a way to make this short code without using a repeat statement?
stackexchange_codegolf
In this problem on Puzzling.SE, I ask a question about determining the amounts of drug to use in a clinical test to minimize total drug usage and fulfill the requirements of the testing procedure. The problem is as follows, for those of you who currently don't have access to the private beta: A medical researcher is t...
stackexchange_codegolf
Write a rectangular block of text that when arranged into a Sierpinski carpet, using same-sized blocks of spaces for the empty portions, creates a program that outputs the iteration number of the carpet. For example, if your text block is TXT BLK then running the program TXTTXTTXT BLKBLKBLK TXT TXT BLK BLK TXTTXTT...
stackexchange_codegolf
The task is to provide code that evaluates to 0.5 numerically, i.e. the output must be recognized by your chosen language as a numeric value (Number, float, double, etc), not as a string. The catch, the characters 0 through to 9 cannot be used. PLEASE NOTE: This IS NOT a golfing challenge, this is a popularity contest,...
stackexchange_codegolf
The goal of this challenge is to make a program that outputs the nth letter of its source code where n is given as input to the program. Like most quine challenges, you are not allowed to read your source code as a file or use any builtin quine functions. Input An integer 0 <= n < len(program). Output The nth character...
stackexchange_codegolf
Given a positive integer N, output the number of pairs of integers 0 <= a <= b < 2**N such that a*b >= 2**N. Rules You may assume that N is less than or equal to the maximum bit width for integers in your language (e.g. for C, N will not exceed 32 or 64, depending on the architecture of the machine). If your language ...
stackexchange_codegolf
This problem is "inspired" from a question that was originally asked on Quora (not for code golfing). I just want to make it a challenge for you guys (and my first problem submission here). Given an array of integer elements v and an integer d (we assume that d is lower or equal to the array's length), consider all th...
stackexchange_codegolf
Inspired by Digits in their lanes Input: An ASCII-art of width ≤ 11, consisting of spaces and #. (You can choose any two distinct characters instead.) Example: # ### # # # # # # # # # ### # # ### # ########### # # # # # ### # # ...
stackexchange_codegolf
It's almost Christmas, so Santa has to plan his route. You're helping him, for reasons unknown. Santa needs help planning the route and wants you to give him a solution, but since you're all ungrateful and unwilling to give to the man who has given you so much, so have decided to give him a program with as few bytes as...
stackexchange_codegolf
Write a function or program that takes as its input a string and prints a truthy value if the string is a pangram (a sequence of letters containing at least one of each letter in the English alphabet) and a falsey value otherwise. Case of letters should be ignored; If the string is abcdefghijklmnopqrstuvwXYZ, then the ...
stackexchange_codegolf
The goal of radiation hardening is to make a program still work after you remove a byte. However, what if a skilled competitor is purposefully trying to mess with you? In this game, each bot will take turns removing one character from the next bot down the line. If the bot fails to produce valid output next turn you ga...
stackexchange_codegolf
Coders are always trying to flatten arrays into boring 1-dimensional entities and it makes me sad. Your task is to unflatten an arbitrary string of characters, outputting a lovely city skyscape. Consider the string: aaabbbbbccqrrssstttttttPPw It looks much better like this: tt tt bb tt ...
stackexchange_codegolf
Let's introduce a simplified variant of the well known Spider Solitaire. From Wikipedia: The main purpose of the game is to remove all cards from the table, assembling them in the tableau before removing them. Initially, 54 cards are dealt to the tableau in ten piles, face down except for the top cards. The tableau pi...
stackexchange_codegolf
Warning: Wouldn't you rather answer a challenge about ponies?1 If you have read The Hostile Hospital, you would know that the Baudelaire orphans, from one of the scraps of paper recovered from the Quagmire's notebooks, they discover a name, "Ana Gram". Later on, they realize that means the word "anagram", not a name....
stackexchange_codegolf
Not a dupe to this. That question asks specifically for counting up forever, while this question allows many other approaches. Write a program or function which, given infinite time and memory, would print an infinite non-periodic output. Clarifications 'Infinite' means the solution keeps outputting something without ...
stackexchange_codegolf
This challenge will have give you a positive integer \$n\$ and ask you to output \$t(n)\$, the number of triangles (up to congruence) satisfying the three conditions: The triangles have perimeter of 1, the triangles have side lengths \$\displaystyle\frac{a_1}{b_1}, \frac{a_2}{b_2}\$, and \$\displaystyle\frac{a_3}{b_3}...
stackexchange_codegolf
Subleq is a Turing-complete esolang with only one instruction, SUBLEQ. This instruction takes in three parameters, A, B, and C, all of which are memory addresses. The instruction subtracts the value in memory address A from that in memory address B, storing it in address B. If the value at B is now less than or equal t...
stackexchange_codegolf
A cyclic number is a number of "n" digits that when multiplied by 1, 2, 3,...n, results in the same digits but in a different order. For example, the number 142,857 is a cyclic number since 142,857 x 2 = 285,714, 142,857 x 3 = 428,571, 142,857 x 4 = 571,428, and so on. Given an integer input, determine if it is a cycli...
stackexchange_codegolf
Description The task of this challenge is to devise a program or function that tracks a given object in an \$n×n\$ space. I/O Your program will be given 3 inputs, which may be taken in any sensible way: n will be the size of the plane's side. (so, for \$n=5\$, your plane will be \$5×5\$). You may assume n will always b...
stackexchange_codegolf
To-Do: Come up with a Better Title Specification: This challenge is similar to kolmogorov-complexity, but with a twist. You goal is to output a finite string that resembles the following string of psuedo-random characters as closely as possible: BABBBBAAABBAABBBBAABBBAABBBABBAABABABBBBABBBBBBAABABBAABABBBABBBABAAAAABA...
stackexchange_codegolf
Your challenge is to compute the Lambert W function. \$W(x)\$ is defined to be the real value(s) \$y\$ such that $$y = W(x) \text{ if } x = ye^y$$ where \$e = 2.718281828...\$ is Euler's number. Sometimes, \$y\$ may not be real. Examples W(-1) = non-real W(-0.1) = -0.11183, -3.57715 W(1) = 0.56714 W(2) = 0.85261 Here'...
stackexchange_codegolf
As the title says, given a valid chess move in algebraic notation, produce the string describing the move. Example: fxg8=Q+ -> Pawn takes g8 promotes to Queen check Bb7# -> Bishop to b7 mate Here is a list of all the keywords and their respective notation R -> Rook x -> takes N -> Knight ...
stackexchange_codegolf
Given two inputs, you should print or return whether the characters in the first string are - in order - inside the second string. For example, we want to check whether the string hello, taken as the first input, and the sample text (the second input) is abhcedddldddloallllll. This should output a truthy value, as the ...
stackexchange_codegolf
The residents of Flapus use a base-8 number system. The numbers are: 0 - Kuzla 1 - Ponara 2 - Boqkel 3 - Colopee 4 - Vruenat 5 - Foham 6 - Stikty 7 - Kricola For numbers over 7, the full name of the last digit comes first, followed by apostrophe and the first characters of the other digit(s), up to and including the fi...
stackexchange_codegolf
Given a matrix of integers \$M\$ and a list of four integers \$L\$, find the sub-matrix \$N\$ whose corners are given by \$L\$ and return the sum of its elements. Suppose you're given the list \$L = [-8, -3, 2, 9]\$ and the following matrix \$M\$. The numbers in the list are highlighted in blue to illustrate: $$ \begi...
stackexchange_codegolf
Determine the length of a UTF-8 byte sequence given its first byte. The following table shows which ranges map to each possible length: Range Length --------- ------ 0x00-0x7F 1 0xC2-0xDF 2 0xE0-0xEF 3 0xF0-0xF4 4 Notes on gaps in the table: 0x80-0xBF are continuation bytes, 0xC0-0xC1 would start an ...
stackexchange_codegolf
There's a little improv warm up game where you arrange yourselves in a circle and send zips, zaps, and zops around by pointing to a person and saying the next word in the sequence, then they do the same until all of you are warmed up or whatever. Your task is to create a program that gives the next word in sequence giv...
stackexchange_codegolf
Tired of always wondering how many more Pokémon you need to catch to get those high-tier evolutions? Wonder no more! Now you will write a complete program or function to calculate it for you! The Challenge: As input, your program will receive a list of the costs in candy to evolve a Pokémon to the next tier. (This list...
stackexchange_codegolf
Python string parsing has quite a few edge cases. This is a string: "a" Putting 2 strings immediately after each other implicitly concatenates them, so this is also a string: "a""a" However, if you put 3 quotes in a row, it will create a "triple quoted string" which can only be ended by another 3 quotes in a row. A t...
stackexchange_codegolf
Disclaimer: The story told within this question is entirely fictional, and invented solely for the purpose of providing an intro. My boss has gotten a new toy robot, and he wants me to help program it. He wants to be able to enter simple arrow instructions to get it to move. These instructions are: ^ (for move fo...
stackexchange_codegolf
You are an employee of Microteque, a leading Silicon Valley startup creating smart microwave ovens for all kinds of strange places. Your customers can get their microwaves printed with patterns to match their kitchens, campers, man caves; even the kitchens of large nation-state facilities have shiny new branded microwa...
stackexchange_codegolf
Write a program that takes a string as input and modifies it by reversing the string in its place by mirroring the position. The first position goes to last, second to second last and so it goes on. In simple words, the string would be mirrored. "In Place" means the program should use \$O(1)\$ additional memory regardl...
stackexchange_codegolf
This is not a challenge but a question, I figured it was on topic because of Non-challenge questions that are related to solving programming puzzles or a particular type of challenge are also on topic. Now on to the question: Is it possible to write any JavaScript code with only 5 letters? JSFuck already does this wi...
stackexchange_codegolf
Challenge : Given two non-negative integers (X and Y > 1) calculate the sum of digits of their powers . i.e : sum of digits of X ^ Y . Input : Two non-negative integers X and Y Output : The sum of digits of X raised to power Y X ^ Y. Examples : 5 , 2 ---> 7 9 , 4 ---> 18 3 , 17...
stackexchange_codegolf
The challenge Given a positive integer N, compute the proportion of N-step walks on a plane that don't intersect themselves. Each step can have any of the 4 possible directions North, East, South, West. A walk intersects itself if it visits a previously visited point. Examples N=1: a single-step walk obviously doesn'...
stackexchange_codegolf
Please participate in the meta discussion about reopening this challenge before casting a vote. Introduction This challenge was inspired by semicolon-#. Deadfish is a non-Turing-complete programming language, created by Jonathan Todd Skinner. It has an accumulator register and contains 4 commands, i, d, s, and o, sta...
stackexchange_codegolf
I just had a genius idea for making the work-life easier - a countdown to a specific date which only counts workdays. The basic task is to create a countdown to a specific date which only includes the workdays in the countdown. As workday counts Monday, Tuesday, Wednesday, Thursday and Friday. The Input should be a sp...
stackexchange_codegolf
The majority function is a boolean function which takes three boolean inputs and returns the most common. For instance if maj(x,y,z) is the majority function and T denotes true and F denotes false then: maj(T,T,T) = T maj(T,T,F) = T maj(T,F,F) = F maj(F,F,F) = F This question concerns writing boolean functions as comp...
stackexchange_codegolf
Print or return the following string: zottffssentettffssenttttttttttttttttttttffffffffffffffffffffsssssssssssssssssssseeeeeeeeeennnnnnnnnno This is the first letter of each of the numbers zero, one, two, all the way up to one hundred. Standard I/O rules apply, but the output must be exactly as shown above, optionally ...
stackexchange_codegolf
Find what is the distance for a given string to its closest palindrome of the same length. For this task I decided to give the characters further away from the string's center more weight (think of it as contributing more torque), proportional to their distance to the center. Let's define the palindrome distance for a ...
stackexchange_codegolf
...Ordinal numbers (or ordinal numerals) are words representing position or rank in a sequential order. From Wikipedia. Your task is, using 2 separate programs (of which can be made from 2 different languages), to output the ordinal sequence from first to nth. You will be outputting the full word second as opposed t...
stackexchange_codegolf
Everyone loves The Big Bang Theory, right? And everyone loves polyglots, right? So let's combine them! Task Your task in each language is quite basic. You must output the name of the one of the 5 main characters of The Big Bang Theory: Sheldon Lee Cooper, Leonard Leakey Hofstadter, Howard Joel Wolowitz, Rajesh Ramayan ...
stackexchange_codegolf
Overview Given a list of digits, find the fewest operations to make 100 Input A string of digits, which may or may not be in numerical order. The order of the digits cannot be changed, however plus (+) or minus (-) operators may be added between each so that the total sum is equal to 100. Output The number of operators...
stackexchange_codegolf
Happy Valentine's Day! To celebrate this day of love and happiness (or sadness and loneliness for those of us who are single...), let's write some code to create some hearts! Specifically, if you take this challenge upon you, you are to write code to output a heart/hearts as an image file, with the ability to easily ch...
stackexchange_codegolf
Introduction Don't worry - no knowledge in mathematics is needed. It is possible to just skip the motivation part, but I think it is nice if a puzzle has a background story. Since the title contains the number I there will be more puzzles of this kind, if you like them. Feedback is highly appreciated. I hope you have f...
stackexchange_codegolf
This task builds on: Find all reflexicons using roman numerals An autogram is a sentence that lists the count of its own letters. Below is one of the first documented autograms found by Lee Sallows in 1983: This pangram lists four a’s, one b, one c, two d’s, twenty-nine e’s, eight f’s, three g’s, five h’s, eleven i’s,...
stackexchange_codegolf
Related, related Introduction The ruler sequence is the sequence of the largest possible numbers \$a_n\$ such that \$2^{a_n}\mid n\$. It is so-called because its pin plot looks similar to a ruler's markings: However, with a slight modification, we can also get a similar sequence. This sequence is \$\{a_1,a_2,a_3,…\}\$...
stackexchange_codegolf
Given an integer p > 1, find the smallest integer q > p such that the list of exponents in the prime factorization of q is the same of that of p, no matter the order or the value of the prime factors. Examples The prime factorization of p = 20 is 22 x 51. The smallest integer greater than p with identical exponents in ...
stackexchange_codegolf
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...
stackexchange_codegolf
Your task is to write a program that outputs its own source code in reverse. However, when the reversed code is run, it should output the source code, facing the correct direction. Example Say your program is abc. When run, it should output cba. cba, when run, should output abc. Rules Your program should follow all the...
stackexchange_codegolf
A pleasing number (according to this definition) is a number that can be passed through the following process (let's use 41802000 as an example): Separate the trailing identical numbers (41802000 => [41802, 000]) Sort the first half of the digits and take the maximum ([41802, 000] => [8, 000]) Take the length of the f...
stackexchange_codegolf
If you are given an array of numbers between 1 and 100 and an integer n, you must remove any instances of an item that appear greater than n times. For example: In : [92, 41, 81, 47, 28, 92, 84, 92, 81], n = 1 Out: [92, 41, 81, 47, 28, 84] The most aesthetic/simple algorithm wins. And since this is a popularity-contes...
stackexchange_codegolf
Inspired by this building (United States Air Force Academy Cadet Chapel, Colorado) Your task is simple, given a positive integer n, output the spiked building to size n Testcases 1 -> ^ /|\ /.|.\ /..|..\ _______ 2 -> ^ ^ /|\/|\ /.|..|.\ /..|..|..\ __________ 7 -> ^ ^ ^ ^ ^ ^ ^ /|\/|\/|\/|\/...
stackexchange_codegolf
This challenge is related to some of the MATL language's features, as part of the May 2018 Language of the Month event. Associated challenge: Function clipboard: copy. Introduction MATL's function clipboard stores ("copies") the inputs to the four most recent calls to normal, input-taking functions. Normal functions a...
stackexchange_codegolf
Background Alice and Bob are creating a golfing language to win every single PPCG challenge. Alice wants to make a two-dimensional language, like ><>, but Bob prefers a prefix-infix syntax like in J. As a compromise, they decide to create a two-dimensional prefix-infix language. The parser is a pain to write, and they ...
stackexchange_codegolf
"Talk" is a baroquified accumulator-based language that is created in response to Dennis's quote on talk.tryitonline.net. Waiting for someone to create an esolang called talk. . The "Talk" language has 4 commands: 00 If the accumulator is 0, set the accumulator to 0. 01 If the accumulator is 0, set the accumulator t...
stackexchange_codegolf
Introduction OEIS sequence A127421 is the sequence of numbers whose decimal expansion is a concatenation of 2 consecutive increasing non-negative numbers. Put simply, every number in the sequence is formed by putting together n with n+1 for some non-negative, integer value of n. The first several terms are: 1, 12, 23,...
stackexchange_codegolf
As if this challenge could be any more Pythonesque in spirit... No prior knowledge of Markov chains or encryption techniques is required. You are a spy who needs to obtain some crucial information from the British security service M1S. The agents of M1S are well aware that their Wi-Fi signals can be intercepted, their ...
stackexchange_codegolf
Balanced ternary is a modified version of ternary (base 3), using the three digits 1,0 and -1 (written as T) to represent numbers. The balanced ternary representation of -n can be obtained by replacing 1 with T and T with 1 in the balanced ternary representation of n. Examples: 1 // decimal: 1 T // decimal: -1 ...
stackexchange_codegolf
For today's task, we have two programs, P and Q, both in the same language. Each of them receives a single-character input. If P receives character K, P says how many times K appeared in Q. (You can use any output format for P or Q; they need not be the same, the only requirement is that your format can represent any n...
stackexchange_codegolf
Lets play golf while we golf. Problem: Distance to the hole initially is 700m Each hit to the ball will make it advance to the hole 250-350m, this should be random. Each hit has a 5% probabilities of going into water, this will make the quantity of hits increase by 1 as a penalty. When ball is under 250m it will adva...
stackexchange_codegolf
A ragged list is a (finite depth) list where each element is either a positive integer or a ragged list. A ragged list is properly tiered if it contains either all positive integers or all properly tiered ragged lists. For example [1,2,3,6] is properly tiered because it is a list of only positive integers. [[1,2],[[1]...
stackexchange_codegolf
On the advice of Ms. Pac-Man who's worried about him getting overweight, Pac-Man has decided to keep track of his daily Pac-Dot intake. Help him count the number of Pac-Dots on a given path in the maze! The maze To help you build your own encoding of the maze, you can get some raw data here. Pac-Man's journey In the c...
stackexchange_codegolf
Objective Given a date, spell it out in Romanized Japanese. I/O Format The input format is flexible. The output format is <month spelling> <day spelling>; note the space. You can freely mix cases in output. You may output trailing newline. Mapping Months Month Spelling January Ichigatsu February Nigatsu Mar...
stackexchange_codegolf
For the purposes of the current challenge to "outline" a word means to surround it successively with its own letters, starting with the last one, and finally to replace the original word in the center with spaces: oooooo onnnno on -> on no onnnno oooooo Task: Given a list of words, con...
stackexchange_codegolf
Introduction Windows 95 used a very simple algorithm for verifying license keys. The scheme of an OEM license key always looked like this: xxxyy-OEM-NNNNNNN-zzzzz The day can be anything within 001-366, and the year cannot be lower than 95 or above 03. xxx represents the day of the year the key was printed on (for exa...
stackexchange_codegolf
Given the battery level L in the range 0-5, your code should draw the following ASCII art. When L=0: ############ # ### # ### # ### ############ When L=1: ############ ### ### ### ### ### ### ############ When L=2: ############ ##### ### ##### ### ##### #...
stackexchange_codegolf
For the purposes of this challenge a substring \$B\$ of some string \$A\$ is string such that it can be obtained by removing some number of characters (possibly zero) from the front and back of \$A\$. For example \$face\$ is a substring of \$defaced\$ \$ de\color{red}{face}d \$ This is also called a contiguous substri...
stackexchange_codegolf
INTRO Let's say you write a passage and you are close to the end of the line wanting to write down a large word. In most languages, you just leave some blank and move to the next line, like a sir. Example - English: blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah this man is ...
stackexchange_codegolf
Fred is a quasi-friendly guy, but in reality he is mean. Because of this, Fred lives alone in a small apartment in Los Altos, CA. Fred is so mean because he is very particular about water. He, therefore, needs your help with figuring out what his water bill is. Your job is to write a function or program that returns h...
stackexchange_codegolf
A reflexicon is a self-descriptive word list that describes its own letter counts. Take for example the one found by Ed Miller in 1985 in English: Sixteen e’s, six f’s, one g, three h’s, nine i’s, nine n’s, five o’s, five r’s, sixteen s’s, five t’s, three u’s, four v’s, one w, four x’s This reflexicon contains exactl...
stackexchange_codegolf
This is an Irregular Webcomic! themed task.* Death is a rather extensive orginization, and, although Head Death has had no trouble telling his employees apart, certain other entities connected to the orginization have had trouble keeping track of them all. Thus, your task here is to, given the title of one of the var...
stackexchange_codegolf