instruction
stringlengths
34
53.1k
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 \ / \ / \ / ...
Your job is to create the slowest growing function you can in no more than 100 bytes. Your program will take as input a nonnegative integer, and output a nonnegative integer. Let's call your program P. It must meet the these two criterion: Its source code must be less than or equal to 100 bytes. For every K, there is ...
Consider the string 160615051. It can be "triangulated" as such: 1 606 15051 Then, each row is a palindrome. Also note that each side on the perimeter is also a palindrome: 1 | 1 | 6 | 6 | 1 | 1 | 15051 Therefore, this string can be considered to be a fully-palindromic triangle. Don'...
(related) Your challenge is to output the highest number you can. You can output as a number or as a string. You must output something that matches the regex ^\d+$, as in only 0-9. The Twist Your source code must be: Same forwards and backwards 3 bytes long The middle byte must be different from the other two Exampl...
This was inspired by a function I recently added to my language Add++. Therefore I will submit an short answer in Add++ but I won't accept it if it wins (it wouldn't be fair) Don't you hate it when you can multiply numbers but not strings? So you should correct that, right? You are to write a function or full program...
You must make a regex that matches everything except itself. For example, PPCG must not match PPCG, but must match everything else, like something, PPC, and PPCG!. Surrounding slashes are not considered part of the regex in flavors where they are usually part of the syntax. The same is true of all delimiters. The rege...
This challenge was inspired by the game Flood. Challenge Given a grid of colors, determine the optimal list of moves to take to convert the whole grid to the same color. First of all, let us say that a pixel is in the "top left chunk" if and only if it is either the top left pixel or it shares an edge with a pixel of t...
The objective of this programming puzzle is to reproduce the following gif. Simplification: If you notice the geometric figures don't exactly touch each other. I think it's simpler if you make each vertex to touch the respective edge, and not to go beyond it. I'm not sure though of how this will alter the configuratio...
The title of Numberphile's newest video, 13532385396179, is a fixed point of the following function \$f\$ on the positive integers: Let \$n\$ be a positive integer. Write the prime factorization in the usual way, e.g. \$60 = 2^2 \cdot 3 \cdot 5\$, in which the primes are written in increasing order, and exponents of 1...
Introduction So my boss is making me do some manual labor...urgh...I have to take a part out a box of parts, process it and put it back in the box. To make this more interesting I try to sort the parts as I do this, as each part has a unique alphanumeric serial number. Unfortunately, I only have room to have four part...
Maybe some of you already know this game: you have a collection of jelly beans of different colors. For every color, the bean can have different tastes, some are good and some are bad, and you cannot tell them apart. You have to pick a bean of a given color, and pray you have select a good one. So, write the shortest p...
Thanks @NathanMerrill for allowing me to post this! The following is entirely his wording from this sandbox post (deleted): We define a "Fresh" substring as a substring that is different from any other substring that starts earlier. For example, if I take the string "abababc" and split it: ["ab","ab","a","bc"], the fi...
Your challenge is to read a "password" from the keyboard / standard input. Challenge: Read a string s invisibly. For each of the characters in s, print a character c. In realtime. Rules: You must print c in realtime. As soon as the user enters a character you must display c. c must be constant, i.e. it must be the s...
The Task Build a function that takes a string of coins ending with an item index, and generates change as a string of coins using the least amount of coins possible. The following are the items that can be bought (0-indexed): [0.45, 0.60, 0.75, 0.95, 1.10, 1.25, 1.40, 1.50, 1.75, 2.00] The following are the coins that ...
Your task today will be to take an existing file and append zeros to it until it reaches a certain size. You must write a program or function which takes the name of a file in the current directory f and a number of bytes b. While maintaining the original content of f, you must write zeroes (null bytes, not ascii 0s) ...
This task is about compressing and processing a sequence of conditionals. In the game Keep Talking and Nobody Explodes, a bomb defuser must disarm a bomb with the help of instructions relayed by experts consulting a convoluted Bomb Defusal Manual. This challenge deals with the module "On the Subject of Wires", explain...
This task is a classic programming task: Implement a regular expression parser. That is, write a program or function which takes a string describing a regular expression and a candidate string, and test whether the complete candidate string matches the regular expression. You may assume that the regular expression pass...
Task The task is to write a script that accepts a number from 1 to 20 inclusive. It will then check if the number has a character that is found in every number that was entered before it. If the number has a character in common it will ask for another number. However if the number does not have a character in common wi...
Your task is to write a program or function which, given two nonzero integers x and y, returns a truthy value if the image at coordinates x east and y north of xkcd's click and drag comic is mostly white and a falsey value otherwise. Specifications The image should be retrieved from imgs.xkcd.com/clickdrag/[y]n[x]e.pn...
A string of characters repeats if it contains two consecutive substrings that are equivalent. For example, 2034384538452 repeats as it contains 3845 twice, consecutively. Therefore, your challenge is to decide whether a string contains a repeating substring. You may take the input as a string or an array of characters....
Task: Given two positive integers, generate a random integer between them (inclusive) and then output all its prime factors. Examples: Input: Random Number: Output: 1,2 2 [2] 12,46 18 [2,9] 142,17 40 [2,2,2,5] Scoring: This is code-golf so the least by...
I recently listed to the song I'm a Textpert about texting while driving and one particular line in the song inspired this challenge. I never stoop so low as to text photos / Instead I text the correct combo of ones and zeros Now obviously, this would be an almost impossible thing to do in ones head and so you should...
This is not an invitation for you to downvote everything I've posted. Just sayin' ;) Challenge Figure out how I can get myself back down to 1 reputation. Details will follow input format, then followed by output. Input Input will consist of the my current reputation, the number of questions I have posted with an accept...
The Discordian calendar is an alternative calendar used by Discordians. The discordian year has 5 seasons, each lasting 73 days: Chaos, Discord, Confusion, Bureaucracy, and The Aftermath. The discordian week has 5 days: Sweetmorn, Boomtime, Pungenday, Prickle-Prickle, and Setting Orange. Every year begins with Sweetmo...
Task Given two positive integers, output the number of carries needed to add them together in long addition in base 10. Examples ¹¹¹ <-- carries 999 + 1 ---- 1000 Three carries are needed. ¹ 348 + 91 ---- 439 One carry is needed. Testcases 999, 1 -> 3 398, 91 -> 1 348, 51 -> 0 348, 52 -> 2 5, 15 -> 1 9...
Challenge Given the formula of a chemical, output the Mr of the compound. Equation Each element in the compound is followed by a number that denotes the number of said atom in the compound. If there isn't a number, there is only one of that atom in the compound. Some examples are: Ethanol (C2H6O) would be C2H6O where ...
Thanks to MD XF's recent challenge, we can now read passwords in many different languages! The problem is, now we need to port our applications to mobile devices, and they do password entry a little differently. Challenge Read a string from the keyboard. Each time a characterk is entered, display it for a short time i...
A while ago, I posted a challenge asking to determine whether or not it's possible to arrange arbitrary rectangles to fill a rectangular space, here. That got answers, so clearly it was too easy. (Just kidding, it was fairly challenging, congrats to the answerers :D) Challenge Given a bunch of arbitrary shapes (consist...
Despite having 17 questions tagged anagrams, we still don't have this question, so here it is. Your Task You must write a program or function that, when receiving a string, prints out all possible anagrams of it. For the purposes of this question, an anagram is a string that contains the same character as the original...
Your Task Write a program that displays a dot that moves toward the position of your mouse at 4 pixels per second. The dot must be 100 pixels big and the window must fill the computer screen. Input None Output A window showing an animated dot moving towards the mouse at a fixed, non-changing speed. Scoring This is code...
This question is heavily based off this question, but should pose a number of additional difficulties. Your Task You must write a program or function that, when receiving a string, prints out all possible anagrams of it. For the purpose of this question, an anagram is a string that contains the same character as the o...
Given an input string S, print S followed by a non-empty separator in the following way: Step 1: S has a 1/2 chance of being printed, and a 1/2 chance for the program to terminate. Step 2: S has a 2/3 chance of being printed, and a 1/3 chance for the program to terminate. Step 3: S has a 3/4 chance of being printed,...
Your Task You will write a program or function to return a truthy value if the integer inputted to it is a square repdigit, and a falsy value if it is not. A repdigit is an integer that contains only one digit (e.g. 2, 44, 9999). For the purpose of this challenge, a square repdigit is a repdigit that is the square of...
Given an input integer n, draw a number snake, that is, a grid measuring n x n consisting of the numbers 1 through n^2 that are wound around each other in the following fashion: Input n = 3: 7 8 9 6 1 2 5 4 3 Input n = 4: 7 8 9 10 6 1 2 11 5 4 3 12 16 15 14 13 Input n = 5: 21 22 23 24 25 20 7 8 9 10 19 6...
Your job is to output the html of the current version (at the time of this writing) of the Wikipedia page for Kolmogorov complexity: https://en.wikipedia.org/w/index.php?title=Kolmogorov_complexity&oldid=781950121&action=raw (backup) This is code-golf, so the shortest code wins.
You should code a piece of code that looks like it outputs the language name but actually outputs the name reversed. E.g. a Python program should look like it outputs Python but should actually output nohtyP. The winner is the answer with the most upvotes in a week!
Your challenge is to write a program or function to output this sequence of numbers. Output requirements: Must contain numbers specified above Must be in order as specified Numbers must be delimited by whitespace Shortest code in bytes wins.
Create a bijective function between the syntactically valid BF programs and the natural numbers This means that you will assign each BF program a nonnegative integer (0,1,2,...) in such a way that each number gets a BF program without syntax errors (and without whitespace or comments). Note that something like Binaryf*...
In this question each answer will get a "toolbox" that can be used to construct a program/function. The toolbox will consist of two things: a list of programming languages a list of valid characters You must write a valid program/function in one of the languages provided using only the characters in the toolbox. Yo...
A quotation is "the repetition of one expression as part of another one". In American English, a quotation is surrounded by double-quotation marks ("), as in the previous sentence. However, this rule differs when a quote appears inside another quote. In this case, the inner quote is surrounded by single-quotation marks...
The Reuleaux triangle is the shape formed by the intersection of three circles, with each circle passing through the others' centers. Regardless of rotation, a Reuleaux triangle's width will always equal the radius of the circles: Image: Wolfram MathWorld Write a program that takes a width r as input and displays a Re...
Problem Starting from n=2 dice: Roll n dice, with each number 1 to 6 equally likely on each die. Check if their sum equals the most probable sum for n dice, that is 3.5*n. If they're equal, terminate. Otherwise, print n, and repeat from the start with n+2 dice Your code doesn't have to do this procedure exactly...
Intro So I've been wasting my time again researching suffix sorting algorithms, evaluating new ideas by hand and in code. But I always struggle to remember the type of my suffixes! Can you tell me which type my suffixes are? Left-most what? A lot of suffix sorting algorithms (SAIS, KA, my own daware) group suffixes int...
Problem Inspired by a previous challenge doing something similar Given positive integer input n output a shape that follows this pattern: input n=1: * * * * * input n=2: ** ** **** ** **** ** ** input n=3: *** *** *** *** ***** *** ***** *** *** *** *** and so on... It has these properties: n*2+1...
Given a list of integers, group the elements which occur most first, then group the next most and so on until each unique element in the list has been grouped once. Examples: Input: [1,2,3] Output: [[1,2,3]] Input: [1,1,1,2,2,3,3,4,5,6] Output: [[1],[2,3],[4,5,6]] Input: [1,1,1,4,5,6,6,6,7,7,8,8,8,8,8,8,8,9,5,6,5,6,...
Given a number n, generate the first n columns of this pattern: # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ################################ ... The height of the column at (1-indexed) n is the numb...
Note: the title was misspelled intentionally. Given a string s, swap the first vowel runs of every 2 words. For this challenge, y is considered a vowel. For example, given an input of "great day sir": 1. Input: "great day sir" 2. Identify pairs of words: "[great day] [sir]" (No word for sir to pair with) 3. Identify th...
Challenge My challenge, is for you to generate a Menger Sponge based on the level/iteration given. You need to draw it in 3d, anyway you can. Examples Inputs: 0, 1, 2, 3 Outputs: Background Information What is a Menger Sponge In mathematics, the Menger sponge (also known as the Menger universal curve) is a fractal c...
Adam West passed away, and I'd like to honor his memory here on PPCG, though I doubt he knew of our existence. While there are many, many different things that this man is known for, none are more prominent than his role as the original batman. I'll always remember my step-father still watching the old-school Batman an...
Overview Your goal is to implement RC4 encryption. RC4 encryption, invented by Ron Rivest (of RSA fame), was designed to be secure, yet simple enough to be implemented from memory by military soldiers on the battlefield. Today, there are several attacks on RC4, but it's still used in many places today. Your program s...
Your Task: You all know what a magic square is! But what about a magic cube? A magic cube is the 3D version of a magic square, and is a set of numbers in a cube, where the sums of every straight (not diagonal) line are equal. You must write a program or function that receives an integer, and returns the number of va...
Background Ramanujan's number, \$1729\$, is called a taxi-cab number due to the (possibly apocryphal) tale of Hardy boarding a cab to visit Ramanujan in hospital having this number, which seemed bland to him. It's since known as the most famous of a class of integers known as "taxicab numbers" which are expressible as ...