instruction
stringlengths
34
53.1k
Simple challenge inspired by the popularity of my previous print invisible text and print real invisible text challenges, and the same length different string challenge. Given a string consisting of only printable characters (0x20 to 0x7E), print every printable character not present in the string. Input A string, or a...
This year my age is a prime number, and so is this year. This conjunction will repeat in 10 years and again in 12. If I live to 100, I will lived exactly 11 years in which my age and the year are both prime. My condolences to those of you born in odd-numbered years, who will experience this phenomenon at most once if a...
In English, nouns can take on two different forms depending on whether they are singular (one) or plural (anything else). For example, we would say "1 dog" but "2 dogs", "0 dogs", "57 dogs" and so forth. In Russian, there are three categories. Instead of "1 dog, 2 dogs, 5 dogs", in Russian it would be "1 собака, 2 соба...
this challenge was based on a sandboxed post by @dmckee Old fashioned cell phones were and are used heavily as texting platforms, unfortunately the keyboard has only 12 + a few buttons, and is therefor ill-suited to naive text entry. Common solutions make use of the traditional telephone coding (generally with a modest...
You may have heard of the "Hacker Logo", also called the "Hacker Emblem". It looks like this: This is a pattern from a mathematical simulation called the Game of Life. The glider is the simplest Life pattern that moves, and the most instantly recognizable of all Life patterns. The challenge The challenge is pretty sim...
This: is a Glider. In Conway's Game of Life, the glider is a famous pattern that rapidly traverses across the board. For today's challenge, we are going to draw an ASCII art Game of Life Board, and place a glider on it. The board we are starting with is this: |_|_|_|_|_|_|_|_|_|_| |_|_|_|_|_|_|_|_|_|_| |_|_|_|_|_|_|_|...
Challenge Input two integers. Integer I/O must be decimal. If the integers are equal, output a truthy value. Otherwise, output a falsy value. Clarifications You will never receive non-integer inputs. You will never receive an input that is outside the bounds [-2³¹, 2³¹). Rules Standard loopholes are disallowed....
Inspired by Does the start equal the end Given a string s and an integer n, output a truthy/falsey as to whether the nth char in s equals the nth from the end char in s. Input A non-empty string and an integer. You can use 0-based indexing or 1-based indexing. The integer is guaranteed to be valid based on the string. ...
Muriel is a language where the only way to loop is to create a quine and execute it. Your job is to create your own language with this property and an implementation of it in a pre-existing language. We will define a Muriel-like language like as follows: It has a built-in command for executing code in its own language...
Overview Given a 2 dimensional array of values with a filled in rectangle, find the position and size of the rectangle. Do it in the fewest array accesses as possible. Requirements The x and y values in the output must be 0-indexed. The top left corner is (0, 0). The output should be the 4-tuple (x, y, width, height)....
Dr. Trump is the head psychiatrist at a mental hospital, which is populated by murdering psychopaths. If 2 psychopaths are left together, they will end up brutally injuring or even killing each other, so Dr. Trump needs to build walls to separate these psychopaths, but owing to the limited amount of funds he has left, ...
Your task is simple: tell me who wins the battle of the letters. The troops There are three different "troops" in this battle, summarized by this table. name | health | damage A 25 25 B 100 5 C 10 50 You may use any three unique characters to represent the the troops, but m...
Challenge Given an input x, create a directory (AKA folder) in the file system with the name x. Languages that are not able to create file system directories are excluded from this challenge. The directory may be created anywhere, as long as the location is writable to the user running the program. Assume that the prog...
What tips do people have for golfing in TeX/LaTeX? Please post one tip per answer, each at least somewhat specific to TeX/LaTeX. Context: I noticed this answer and that there is no tips question for TeX/LaTeX, so I'm creating this one. There's some overlap with the narrower question tips for golfing in TikZ (as TikZ i...
Based on this challenge, you must determine if a string is covfefey, that is, could it have been produced as output from a covfefifier? The string will be composed of only alphabet chars (^[a-z]\*$, ^[A-Z]\*$ are possible schemes for input. change the regexs appropriately if using caps) To do this, there are a few chec...
Writing quines is hard. Why not have your computer write them for you! Your program will take as input an interpreter (in a Turing complete language of your choosing) for a language X, and you will output a quine in language X. Notes: Language X is guaranteed to be Turing complete (you do not need to check this (it wo...
You are given a very special gun with a full magazine. Let n be the initial number of bullets in the magazine and i the number of bullets left. That gun is really unreliable, hence each time you shoot, you have a i/n chance to successfully shoot. The fewer bullets you have left, the more tries it requires to shoot. The...
Steve Ballmer is the ex-CEO of Microsoft, and in a recent article, claimed that he "still does not know what he did wrong with mobile". As CodeProject's newsletter pointed out, "That article's title could be ended at so many spots and still be accurate". Given no input, output the following: Steve Ballmer still does no...
The WannaCrypt ransomware has struck and it is attacking networks right, left and center. A network is defined by an m*n binary matrix (a), which has a a[i][j] = 1 if a computer is infected and a[i][j] = 0 if it is not. At the end of each hour, all computers that are a neighbour (which shares a side or a corner with) ...
DONT EVALUATE YET, ALMOST FINISHED, NEED A CLEAR WINNING CRITERION Make me rich in minecraft Minecraft is a 3D game made of blocks that you can destroy and place. There are some interesting farms you can build to provide you with game resources. In this problem, we will only have a look at pumpkin and melons farms. Her...
Challenge Given a list of keys and values, and a target n, return all sets of keys where the sum of their values equals or exceeds n. Input Input will be like this: [["Part 1", 20], ["Part 2", 15], ["Part 3", 14.75], ["Part 4", 3]], 30 Input consists of a list with keys (which can be any kind of string) and values (wh...
I've always liked screens full of randomly colored pixels. They're interesting to look at and the programs that draw them are fun to watch. The challenge Fill your screen, or a graphical window, with colored pixels. The rules Your program must have an even chance of picking all colors (i.e in the range #000000 to #FFF...
A narcissist program is a program that only accepts its own source code. A bigotous program is a program that only accepts the source code of programs semantically equivalent to itself. A gang member is somewhere in between. In particular, we will define a gang as set of programs G, which may or may not be in the same ...
Background The Hamming weight of an integer is the number of ones in its binary representation. For this challenge, integers are represented with 32 bits, and they are unsigned. Challenge Given an integer between 0 and 2^32-1 (non-inclusive), output a different integer within the same range, and also with the same Hamm...
The naming conventions for games in the Super Mario series is very strange, and don't match up between regions. | Japanese Name | American Name | |---------------------|------------------------------------| | Super Mario Bros. | Super Mario Bros. | | Super Mario Bros. 2 | S...
The Challenge Generate 1 sec of an 8 bit tone sampled at 256 samples per second. The tone will be made up of a number of sine waves. The frequency of each sine wave will be determined from the input data. These are deep tones, too low for a human to perceive, but I've chosen 8 bit numbers here since it's code-golf. The...
Recently, an electrical engineer studying traffic light timings was fined $500 by the state of Oregon for referring to himself as an engineer. Given a 2 letter string as input, representing a US state, output: I am not an engineer if the state is Oregon (OR) I am an engineer if the state is any other US state What is ...
Related Task Your task is to calculate the new Elo rating (FIDE rating system) for a player after winning, losing or drawing a game of chess. To calculate the Elo rating two formulas are needed: R' = R0 + K*(S - E) E = 1 / (1 + 10 ^ ((R1 - R0) / 400)) where: R' is the new rating for player0, R0 is the current rating ...
Given an ASCII representation of a piece of string, determine its length. Input An multi-line ASCII rendering of a piece of string, which runs from top to bottom, with one 'node' (corner) on each line of input. The delimiter may be assumed to be CR, LF, CRLF, or LFCR. Input may be accepted from STDIN, Command Line Argu...
Concept Remembering numbers can be difficult. Remembering a word may be easier. In order to memorize big numbers, I created a way to pronounce them in a leetspeak-like way. Rules Each digit is first replaced by its corresponding letter: 0 => O 1 => I 2 => R 3 => E 4 => A 5 => S 6 => G 7 => T 8 => B 9 => P After the re...
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...
Let's imagine we have a finite set of positive integers. This set can be represented as a line of dots where each integer present in the set is filled in like a scantron or punch card. For example the set {1,3,4,6} could be represented as: *.**.* * represents a member of our set and . represents an integer that is n...
When writing code-golf programs, I usually end up using some numeric constants. I always put them in decimal because that's how I think, but I just realized that my language supports other number formats that might let me shorten my code slightly. Challenge Given a non-negative integer less than 2^53-1, decide whether ...
Task You must write a program in Language A that will output the source code for a program in Language B which will then output the source code for a program in Language C and so on and so forth. The final program must output the x root y where x and y are the inputs e.g. in Python: print(int(input()) ** (1/int(input()...
Your task is to take an encrypted string as input, and output the string decrypted, to reveal its hidden message. The strings, both the input and output, will contain characters from this list of 64 ASCII-characters (note the leading space): !"#$%&'()*+,-./0123456789:;=?@[\]^_abcdefghijklmnopqrstuvwxyz|~ These charac...
Are there any functional programming languages designed for code golfing? I know that golfscript and CJam fulfill the same category for stack based, but I couldn't find a functional code golfing language.
I love math. But I can't find a single calculator that can multiply correctly. They seem to get everything right except 6*9 (It's the question to life, the universe, and everything! How could they get that wrong?!). So I want you all to write a function for me that can multiply 2 numbers correctly (and 6*9 equals 42 in...
Recently, someone proposed more stringent limits for Python's default line length: Clearly, no program should ever use more than 80 characters per line, for a whole host of reasons. First and foremost, for readability and maintainability, it is important to have a solid standard, so we can adjust the width of our text...
The Challenge: Draw a rectangle of ASCII boxes: [] The Rules: Takes a width and a height input You can assume both of these are numbers Must produce a string with newline characters, \n Examples: 2, 2: [][] [][] 2, 3: [][] [][] [][] Fewest Bytes wins.
Be sure to see the other challenge, Reverse ASCII character map! The ASCII charset (American Standard Code for Information Interchange) is the most widely-used character encoding standard. ASCII codes represent text in computers, telecommunications equipment, and other devices. Challenge Your challenge is to print a ...
Challenge: Your task is to write as many programs / functions / snippets as you can, where each one outputs / prints / returns an integer. The first program must output the integer 1, the second one 2 and so on. You can not reuse any characters between the programs. So, if the first program is: x==x, then you may not u...
Many people know what a truth machine in programming is. But is time we kick things up a notch. Introducing, the extended truth machine! An extended truth machine takes two things as input, a integer n and a nonempty string s. It outputs s n times with optional trailing whitespace. However, if n is equal to 0, you must...
The reverse of an n-bit number is just its n binary digits in reverse order: 001010010 → 010010100 Given a number n, generate all n-bit integers ([0, 2n-1]) in an arbitrary order, with only one restriction: there must be a splitting point such that the reverse of an integer is on the opposite side of the splitting p...
Introduction Given a String containing an arithmetic expression, your task is to output a truthy or falsey value based on whether it contains unmatched parentheses. Input Your program should take in a String containing an arithmetic expression. It may take input in any way except assuming it to be present in a pre-def...
Challenge Given an integer, n, as input where 0 <= n <= 2^10, output the nth even perfect number. Perfect Numbers A perfect number is a number, x where the sum of its factors (excluding itself) equals x. For example, 6: 6: 1, 2, 3, 6 And, of course, 1 + 2 + 3 = 6, so 6 is perfect. If a perfect number, x, is even, x mo...
Given two numbers n and m, evaluate the infinite power tower: n^(n+1)^(n+2)^(n+3)^(n+4)^... mod m Keep in mind that ^ is right-associative. So 2^3^4 = 2^(3^4). Now how can you possibly assign a value to an infinite sequence of right-associative operators? Define f(n,m,i) as the power tower containing the first i ter...
Challenge An ascii string is made 'dank' when exactly one space is inserted between any two consecutive letters and all capital letters are replaced with lowercase ones. In this challenge I would like you to write a program that takes a string (not necessarily 'dank') as input and outputs a 'dank' version of that strin...
Inspired by a restriction on What do you get when you multiply 6 by 9? (42) By order of the President, we are no longer permitted to use confusing fake numbers (i.e. numbers other than integers from 0 to 99 inclusive), and are instead to use only real numbers, that is, those that are not fake. Unfortunately, most maths...
Consider a binary string S of length n. Indexing from 1, we can compute the Hamming distances between S[1..i+1] and S[n-i..n] for all i in order from 0 to n-1. The Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. For example, S = 01010...
Abbreviate that US state! was fun, but we learnt that efficiently abbreviating US state names is hard with the current system. Let's come up with an alternative state code scheme for efficient golfing. Your task: Write a function (or program) which, given a valid US state name (only the 50 normal states required), ret...
There are many magic squares, but there is just one non-trivial magic hexagon, as Dr. James Grime explained, which is the following: 18 17 3 11 1 7 19 9 6 5 2 16 14 8 4 12 15 13 10 As it is done in Hexagony this is easiest written as just one line, by just reading it row by row: 18 17 3 11 1 7 19 9 6 5 2...
This is the sequel to one of my previous challenges, Three-Three-Three! Write a program (or function, or snippet) that takes no input and produces an output according to the following four Conditions. Both the program and the output must be written such that: At least 16 distinct characters appear (since 16 = 4 × 4)...
Given a 7-segment display with some segments switched on and some off, find a sequence of digits (0-9), such that after toggling the corresponding segments for each digit, all segments are switched off. Example _ _ [3] => | [1] => [OFF] _ | Numbers and their corresponding segments: _ ...
As a fan of an at most moderately successful footballBE team, towards the end of the season I often wonder whether my favourite team still has any theoretical chance left of becoming champion. Your task in this challenge is to answer that question for me. Input You will recieve three inputs: the current table, the lis...
The other day, my son asked me to build him a staircase using Lego-ish blocks. And I came up with something like this: Then my kid asked me for a program using the least number of bytes that generated a similar staircase in a computer screen. I am not that good at code-golf, so I need your help. I need a program that:...
Task You should write a program that when a button is pressed, it outputs a different sound for each key. The keys that you will use are: 1!2"34$5%6^78*9(0qQwWeErtTyYuiIoOpPasSdDfgGhHjJklLzZxcCvVbBnm The notes begin at C and each key above adds one semitone. Lets make it slightly easier for you though. You can choose ...
Input None Output 52 cards. No duplicates. Cards are represented as their unicode characters, e.g. . The Unicode codepoints follow the following format: The first three digits are 1F0. The next digit is A, B, C, or D for spades, hearts, diamonds, and clubs respectively. The next digit is 1 through C and E for the vari...
Your code may not contain the letter "e", but must count the number of "e"s in the inputted string and output that as a number. Bonus points if you use a language that is not a codegolf language and a language that actually uses the letter e (unlike brainfuck) --- not a required criteria.
A Ken Thompson virus is a virus that infects your compiler and other programs. Since it infects all your tools, you can not detect it without using tools from before the virus was introduced. Your will create a prototype for inserting the Ken Thompson virus into code. The goal of this virus will be to allow you to (fak...
What general tips do you have for golfing in V? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to V (e.g. "remove comments" is not an answer). Since V is heavily based on vim, most of the tips for golfing vim would apply too. But there are some features in...
There are 8 Australian states and territories, each with a 2 or 3 letter abbreviation: ACT: Australian Capital Territory NSW: New South Wales NT: Northern Territory QLD: Queensland SA: South Australia TAS: Tasmania VIC: Victoria WA: Western Australia Your task is to write a function/program which takes a valid Austr...
Break two numbers up into their powers of 2, if they share any, return a falsey value. Otherwise, return a truthy value. If one input is 0, the answer will always be truthy. if one input is 255, the answer will be falsey if the other is not 0. Example Given 5 and 3 5 = 2⁰ + 2² 3 = 2⁰ + 2¹ Both share 2⁰, return falsey....
Break two numbers up into their factorials; if they share any, return a falsey value. Otherwise, return a truthy value. (inspired by this recent question) In other words, write each input number as the sum of factorials (of positive integers) in the greediest possible way; return a truthy value if no factorial appears ...
Based on How high can you count? let us give an advantage to the polyglot people. Challenge: Your task is to write as many programs / functions / snippets as you can, where each one outputs / prints / returns an integer. The first program must output the integer 1, the second one 2 and so on. You can not reuse any char...
Let's say you have a 20-sided die. You start rolling that die and have to roll it a few dozen times before you finally roll all 20 values. You wonder, how many rolls do I need before I get a 50% chance of seeing all 20 values? And how many rolls of an n-sided die do I need to roll before I roll all n sides? After some...
Given an input, output that input followed by a newline endlessly. Input will be a string consisting only of printable ASCII characters (0x20-0x7E) and newlines (0x0A). If input is length 0, endlessly output newlines. This is code-golf so fewest bytes in each language wins!
Introduction "Muhuhuhahahah!" The mad scientist laughs. "You're trapped in my own little game!" In front of you is a deadly pit of snakes, while behind you is a bottomless chasm. There's no way out, you're stuck! "Two steps in front of you is the snake pit, and two steps behind you is the chasm. But! Before you move, y...
The xorspace of a set of integers is the set of all integers that can be obtained by combining the starting integers with the usual bitwise xor operator (^). For example, the xorspace of (8, 4) is (0, 4, 8, 12): 0 is 4^4, 12 is 4^8, and no other numbers can be reached. Note that the starting numbers are always included...
You end up having a lot of very long, boring-looking conditionals in your code: if flag == 1: while have != needed: if type == 7: These can be transformed into their much more lovable <3 conditionals counterparts: if abs(flag - 1) + 2 <3: while 3 - abs(have - needed) <3: if 2 + abs(type - 7) <3: Task Your task is...
Your task is given an input string of the full/short name of a CS:GO (Counter-Strike: Global Offensive, a computer game) rank return an integer from 1-18 representing the rank number. A higher number means you are a higher rank and so "better" at CS:GO. Input A string representing either the full name or short name of ...
The task is simple, given two IP adresses a and b, output all addresses within that range. Examples Example #1: f(a = 192.168.0.1, b = 192.168.0.4) 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4 Example #2 (TIO will truncate this, use a smaller range when testing): f (a = 123.0.200.0, b = 124.0.0.0)...
I'm golfing a program to sum two numbers in C++. Example: 10 3 13 I found out that this problem can be solved in 54 symbols (without spaces and so on) using C++. My code (63 symbols): #include <iostream> main() { int a, b; std::cin >> a >> b; std::cout << a + b; } I have no idea how to make my program sho...
The Language: Oppification A funny language to speak is created by applying the following process to each word: Place op after each consonant. So Code becomes Copodope. Yes, that's it. For the purpose of this challenge, y is always a consonant. The Challenge: De-oppification Given an oppified word, return the origina...
Just take an input in any way and then print it backward (trailing newlines allowed). For example: Hello World -> dlroW olleH Hi -> iH Yes, it is case sensitive. Shortest code wins
Your task is to write a program that, given a number n, returns a list of all valid, halting Smallfuck programs of length n, in any order. Actually, we're using a variation of Smallfuck called F2, which is just Smallfuck with a right-unbounded tape. For the purposes of this challenge, a program that moves left from the...
A fairly simple challenge: You will receive two inputs, a string and a number (the number may be taken as a string, ie "123" instead of 123) If the string does not end in a number (ie, it does not match the regex \d$), just append the number to the end of the string. If the string does end in a number (ie, it matches t...
Given no input, output the following: _ | ~-_ | o ~-_ | ~ ~-_ | \~~~~~~ | * \ | \ |~~~~~~~~~~\ Note the backslashes are actually \, which is U+FF3C Trailing whitespace is allowed, however leading whitespace is not. This is code-golf so fewest bytes in each language wins!
A string is considered to be square if the following conditions are met: Each line has the same number of characters The number of characters on each line is equal to the number of lines. Your task is to write a program or function which determines whether or not a given input string is a square. You may require inp...
Given a width and a block of text containing possible hyphen- ation points, format it fully- justified (in monospace). Fully justified means it is aligned on the left and the right, and is achieved by increasing the spacing between words until each line fits. Related: Justify a text by adding spaces Align the t...
I remember this was exam question long long long time ago. There is a file say MyFile.txt, it can be any size and contains aphanumeric only your task is to revese the words example : "Go beyond the traditional laptop with Surface Laptop. It's backed by the best of Microsoft, including Windows and Office" It should be "...
Your task: Create a program that encrypts a string with another string using a key, using the vigenere cipher. What a vigenere cipher does Ciphertext: string Key: keya | | v v string keyake | v (18)(19)(17)(08)(13)(06) (10)(04)(24)(00)(10)(04) | v (28)(23)(41)(08)(23)(10) ...
Minecraft 1.12 will be released tomorrow, so let's celebrate! Write code that takes in a non-negative integer N which represents the number of items of something in Minecraft. Output it in a way more helpful to players, giving the number of chests, stacks, and items N is equivalent to. Use the format XcYsZi where X i...
This is very similar to this challenge, "Implode the Box". It was a pretty nice challenge and it didn't get many answers, so I'm going to post a similar challenge (strongly) inspired by it. ASCII Boxes look like this: ++ +---+ +------+ +---+ +---+ ++ | | | | | | | | ...
Given a non-empty array of positive integers, determine if it is possible to take squares with side lengths specified by each integer, and arrange them in space such that they form a square. The output can have anything as truthy / falsey values, and the input array may contain duplicates. For the truthy testcase [3,2,...
In this question I asked you to guess an anagram quine based on its output. However it looks like we don't have a question asking to golf an anagram quine yet. So your task will be to make the shortest anagram quine that you can. What is an anagram quine? An anagram quine is a non empty program that prints an anagram...
Brainf**k is the most famous esoteric programming language and is the inspiration for hundreds of other esoteric languages. In fact, there are quite a few languages that are so heavily based off of Brainf**k that the only difference is the characters used. Your challenge is to interpret one of these languages. Brainf**...
Task Given two lists of characters, output their Cartesian product, i.e. the list of pairings of each letter from the first list with each letter from the second list. Example "123456" and "abcd" give: [["1","a"],["1","b"],["1","c"],["1","d"],["2","a"],["2","b"],["2","c"],["2","d"],["3","a"],["3","b"],["3","c"],["3","d...
Background A rooted tree is an acyclic graph such that there is exactly one path from one node, called the root, to each other node. A node v is called the parent of another node u if and only if the path from the root to u goes through v and there is an edge connecting u and v. If node v is the parent of node u, node ...
Given no input, your task is to generate the following: a b c d e f g h i j k l m n o p q r s t u ...
Challenge A repdigit is a non-negative integer whose digits are all equal. Create a function or complete program that takes a single integer as input and outputs a truthy value if the input number is a repdigit in base 10 and falsy value otherwise. The input is guaranteed to be a positive integer. You may take and use ...
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 ...
When I saw this title in the Hot Network Questions I thought it was going to be a PPCG challenge. I was a little disappointed when it was on Mathematica. So now it is on PPCG: Challenge Given an input string, output the ROT13, flipped value. The input will contain characters from the following alphabet: [abcdefghijklmn...
Challenge So, um, it seems that, while we have plenty of challenges that work with square numbers or numbers of other shapes, we don't have one that simply asks: Given an integer n (where n>=0) as input return a truthy value if n is a perfect square or a falsey value if not. Rules You may take input by any reasonable...
Background Hello golfers! I would like to learn all the programming languages! But I kinda have a short attention span... and copying all the Hello World examples gets boring... but I like fire! ^w^ Challenge So here is the plan! I want you all to write the smallest code that will compile, print Goodbye Cruel World!, ...
Definitions A bijection from a set S to a set T is a function from S to T such that one element in T is mapped by exactly one element in S. A bijection within a set S is a bijection from S to S. The natural numbers are the integers which are greater than or equal to 0. A subset of a set S is a set such that every elem...
Given a string as input, output one or more variants of the string such that: No character is in it's original position No character is adjacent to a character that it was originally adjacent to You can assume this will always be possible for the given string, and will only contain single case alphabetical characters...
Your task today is to implement a time limit for getting input, a task I've found rather annoying to achieve in most languages. You will create a program function which prompts the user for input. Immediatly after the user supplies input, print the message input received and end execution/return. However, if the user w...
Mayube recently posted Garble that string. However, humans aren't too good at checking whether a string is actually garbled or not. (Actually, that's an understatement, we are really bad at it.) So, let's save some time making test cases, and see if a string is actually garbled. Input Two strings, containing only lower...
Your challenge: Write a function that takes a string s, a character c, and finds the length of the longest run of c in s. The length of the run will be l. Rules: If s is of length 0 or c is empty, l should be 0. If there are no instances of c in s, l should be 0. Standard loopholes and Standard I/O Rules apply. No mat...
Given a non-negative integer, print out an X that is that big. X is the output for input 0, and you will add slashes equal to the input in each direction to extend the X for larger inputs. Test Cases 0 X 1 \ / X / \ 2 \ / \ / X / \ / \ ... 10 \ / \ / \ / ...