instruction
stringlengths
34
53.1k
Note to Moderators and editors: This post's title is for effect and should not be changed. The misspelling is intentional and part of the challenge. Backstory The (stereo)typical bad SO question asks something along the lines of "plz send teh codez!" In other words, it asks someone to do the work for the asker and ...
Introduction You may know and love your normal unit circle. But mathematicans are crazy and thus they have abstracted the concept to any point that satisfies x*x+y*y=1. Because Cryptographers1 are also weird, they love finite fields and sometimes finite rings (it is not like they have much choice though), so let's comb...
Input: a sequence of uppercase letters (ASCII [65;90]) which is the Nth* lexicographical permutation of the multiset of its characters *permutations are numbered from 0 or 1 upwards Output: base-10 integer N Rulez There might be duplicates (that's how this challenge differs from this one) The characters are ordered b...
Your challenge is simple: write a program or function which appears to print the first ten numbers of any integer sequence (on OEIS, the answerer may choose which sequence), but instead prints the exact text: Happy April Fool's Day! if and only if it is run on April 1st of any year. Run on any other day should make it...
Note: The winning answer will be selected on 4/12/17 the current winner is Jolf, 1 byte. I'm surprised that we haven't had a what's my middle name challenge on this site yet. I did alot of searching but found nothing. If this is a dup, please flag it as such. Your challenge Parse a string that looks like Jo Jean Smit...
In this challenge we try to solve two important problems at once. They are: Given integers \$a\$ and \$b\$, tell if \$a^b-1\$ is a prime number. Given integers \$a\$ and \$b\$, return \$a\choose b\$. Specifically, you must write two programs, one that does the first task and one that does the other. As we want to sol...
The pigeonhole principle states that If N items are put into M boxes, with N > M, then at least one box must contain more than one item. For many, this principle has a special status compared to other mathematical enouncements. As E.W. Dijkstra wrote, It is surrounded by some mystique. Proofs using it are often rega...
Well, Brexit happened. And Sky News, being the geniuses they are, have decided to create a countdown on the side of a bus. Your job is to do something similar. The UK leaves the the EU on 31st of March 2019 and you have to create a digital countdown for this that changes every second (with a 0.05 second deviation allo...
Input: 2 numbers, x and y. Output: Output a text block where x is the width of the text block and y is the height of the text block. Then there will be a straight line going from the top left to the bottom right and to show it, there should be a # where the line should cross. The # should be generated using the straigh...
Perfect License Plates Starting a few years ago, I made myself a little game while driving around: checking if nearby license plates are "perfect". It's relatively rare, but exciting when you find one. To check if a license plate is perfect: Sum up the characters, with A = 1, B = 2, ... Z = 26. Take each consecutive...
Challenge: Output the 'integer-digits' of one of the following six arithmetic-tables based on the input: - addition (+); - subtraction (-); - multiplication (*); - division (/); - exponentiation (^); - modulo operation (%). Rules: What do I define as 'integer-digits': Every result of the arithmetic operand which is ex...
Task: Crack the scrambled code for multiplying the square root of an integer n by the square of it! You must post a comment in the cops' thread with a link to your working source, mentioning clearly that you have Cracked it. In your answer's title, you must include the link to the original answer. Rules: You may only ...
Note: This is the cops' thread, where one should post the scrambled code. Here is the robbers' thread where the cracked source should be posted and linked to the cop's answer. Task: Write the shortest safe program which multiplies the square root of an integer n by the square of n This is cops-and-robbers, so the rule...
Am I under Budget? Every 2 weeks when I get my cheque, I allocate a certain amount to last me until my next cheque, and bank the rest. To figure out how much I can spend per day and still remain under/on budget, I just need to divide the allocated amount by the number of days it needs to last me. On Day 1 if the budget...
I need this down to as few characters as possible. I would use Test-NetConnection but I need PSv2 compatability. Any help would be appreciated. $socket = new-object Net.Sockets.TcpClient $socket.Connect("192.168.5.5",445) $socket.Connected As a note I have tried this but it doesn't work (new-object Net.Sockets.TcpCl...
Piet is an interesting programming language for a number of reasons. Today we will focus on one reason: the roll command. The roll command was originally from PostScript and is a powerful way to manipulate the stack. The roll command pops the top two elements of the stack and uses them as parameters. We'll call the fir...
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...
Did you notice, that this is a palindrome? Input Non-negative integer number or string representing it Output 4 possible outputs, representing two properties of number: is it palindrome tricky #2 Tricky #2 property If number is not palindrome, this property answers the question "Do the first and the last digits have...
Task Read in a possibly infinite text stream or file, outputting its contents until the word hello has been output, abiding to the following rules. Once hello has been output, your code should quit immediately. It should not wait for a newline for example. Your code should output as it goes. That is it shouldn't read ...
The Manhattan distance on a regular grid is the number of orthogonal steps one needs to take to reach one cell from another. Orthogonal steps are those that go through the edges of the grid cells (as opposed to the corners, which would give us the Chebyshev distance). We can define a similar distance on other grids, fo...
Alice, Bob, Carol, Dave, and Eve are going out for a nice game of golf and need your help to decide in what order they will play. Your program will input some statements, which are defined as a condition, and then one or more optional logical boolean operators followed by another condition. (That's [Condition]([Logical...
Introduction It was just a normal day, here at your military base. Suddenly, you looked up to see a bomb falling down from the sky! You need to create a program to predict where it will fall, and tell you the location. Challenge You will be given a bomb in the form of Start-X Start-Y X-velocity Y-velocity. You can assu...
Background The language BrainF*** (or simply BF), is an extremely minimal programming language. We're going to strip it back even further by eliminating IO operations; only the sub-langage defined by the operations +-<>[], henceforth referred to as BF-subset, shall be used. The BF variant considered has a tape extendin...
Example run added 4/11 Rules Clarification 4/8: All submissions will be competing in one giant free-for-all tournament consisting of as many matches as my computer can perform in 48 hours. Anyone who's spent any time watching streams on Twitch is aware of the prevalence of DeepBot, and is perhaps even familiar with its...
Sometimes I find myself wanting a hot dog (don't we all) and so I make one. Now to make a hot dog, it is very simple. 1) Put the hot dogs into boiling water 2) Wait for a certain amount of time (detailed below) 3) Eat the hot dog once the time has elapsed. You may have noticed that I said certain time (detailed below...
Given two permutations in disjoint cycle form, output their product/composition in disjoint cycle form. To find the composition, convert the disjoint cycles to permutations in two-line notation. Each number in a disjoint part of a cycle is mapped to the number following it in the same part. It wraps around. So 1 -> 5,...
The dealer has been sloppy and lost track of what cards his/her deck contains and what cards are missing, can you help him/her? A complete deck consists of 52 playing cards, namely: Each color in the deck (hearts, diamonds, spades, clubs) contains: The numbers [2 - 10] A Jack A Queen A King An Ace Task Your program...
Disclaimer: This isn't my challenge but ThisGuy said I was OK to post. Occasionally I want to make a word into it's opposite, like happiness goes to unhappiness. Unfortunately when this happens, my brain will sometimes go blank. Then one day, after yet another this happening, I thought to my self "This is what program...
Introduction One day, you were just relaxing in your office in the CIA, when suddenly you see an alert on your computer. Your programs have just intercepted hundreds of coded messages! A quick examination reveals the rule for encoding, but you need a program in order to decode fast. Challenge You will be given a list...
Challenge: There's a silly puzzle circulating on social networks that reads: 8 + 2 = 16106 5 + 4 = 2091 9 + 6 = ? Implement a function or operator that, when given two positive integer numbers x and y such that x > y > 0, yields the correct answer as an integer, where the answer's digits are the digits of x * y follow...
April 5th is National Deep DIsh Pizza Day, the theme of this challenge. Given a positive integer n (n is greater than 0), create an ASCII deep dish pizza. Actual deep dish pizza shown: As you can see, there is a layer of crust on the bottom and surrounding the rest of the pizza. How to make the pizza The crust is mad...
Your Challenge You must write a program/function etc. that takes a domain name of a StackExchange site and outputs the domain for the meta version of the site passed to it. Examples: stackoverflow.com => meta.stackoverflow.com codegolf.stackexchange.com => codegolf.meta.stackexchange.com mathoverflow.net => meta.mathov...
It is common to start countdowns 100 days prior to an event, probably because of our base 10 system. Examples of this can be found everywhere: 100 days until your birthday 100 days until the wedding 100 days until the election 100 days until our graduation 100 days until her due date 100 days until football season 100...
Purpose The idea is to provide the code necessary to map a 32-bit integer to/from a pronouncable word of 9 characters maximum. That could be useful, for example, to make a serial number easier to remember, or type in a form. Both the method for translating an integer to the corresponding word and for translating back a...
For this challenge you need to implement two functions, f and g, on the integers, such that f ∘ g is a strictly decreasing function while g ∘ f is a strictly increasing function. In other words, if you take any two integers a < b, then f(g(a)) > f(g(b)) and g(f(a)) < g(f(b)). There are no restrictions on f and g indivi...
There are clever ways of determining whether a number is a power of 2. That's no longer an interesting problem, so let's determine whether a given integer is an integer power of -2. For example: -2 => yes: (-2)¹ -1 => no 0 => no 1 => yes: (-2)⁰ 2 => no 3 => no 4 => yes: (-2)² Rules You may write a program or a func...
A quine is a program that produces output that's identical to the program's source code. On this website, we generally only care about proper quines (at the time of writing, the current definition is "some part of the output is encoded by a different part of the program"). What advice do you have for writing proper qui...
This is a version of the recent challenge Is this number an integer power of -2? with a different set of criteria designed to highlight the interesting nature of the problem and make the challenge more difficult. I put some consideration into it here. The challenge as wonderfully stated by Toby in the linked question, ...
Backstory Not really real, sshh! It all started one day when a coworker brought in a homemade loaf of bread for my boss's birthday. My boss really liked this loaf of bread, and he wanted another. Unfortunately, my coworker has quit, so my boss needs me to give him another loaf. The problem is, I have no idea how to mak...
It's a funny accident that this world happens to have just 1 time dimension, but it doesn't have to be like that. It's easy to imagine worlds with 2 or more time dimensions, and in those worlds you could build computers and run software on them, just like in this one. The System Here is a system for running Brainf*ck p...
(Inspired by ASCII's 95 Characters...95 Movie Quotes) The Challenge Given input n, output the nth Fibonacci number. You can use either 0 or 1 indexing, please state which in your submission. Simple, yeah? The catch is you must take the character set of the immediate previous answer, remove two characters from it, and a...
Note: This challenge only allows answers in compiled languages Task Your task is pretty simple, make two different programs that when compiled result in the same output. Scoring Here is where the fun comes in. Your score will be the number of unique bytes present in exactly one program. For example if your two progra...
This question is inspired by this one Your task Make a program or function that calculates the Tetration of 2 numbers. Tetration is what "comes next after addition, multiplication, and exponents". For example, passing in 3 and 3, this is calculated: 3 ^ (3 ^ 3) yielding this: 7625597484987 Simple, right? WRONG. Rule...
The Problem: This challenge comes from a real problem I was having. I have a dual monitor setup at work, and I wanted to use the following image as my wallpaper: However, my monitors have quite significant bezels, and when I set my background, it looks something like this, where the pier appears (appiers?) to be broke...
Literally! April 6th is National Teflon Day, which is celebrated with Teflon-coated pans (what we will be making). So, given a positive integer n, create a Teflon pan. The "pan" section of the pan is an octagon with each of its sides consisting of n characters, which will vary depending on which side it is except for t...
I'm trying to strip down my python code to be as few lines as possible. The task: count how many square numbers are below 100. Here's my code so far: m = 0 for x in range(0, 100): m+=1-(-((-((x+1)**(0.5)-((x+1)**(0.5))//1))//1)); print(m) That addition statement adds 1 to m (the counter) only when (x+1) is a perfe...
Inspired by Golf me an ASCII Alphabet, of which this challenge is (almost) a direct inverse. Task: Take a string of ASCII-art text and output the content of the text as regular ASCII text. Input: String of ASCII-art text. Input will only contain instances of ASCII character #, spaces and 4 or 5 newlines (a trailing n...
In this challenge, your task is to decipher a string. Luckily, the algorithm is pretty simple: reading from left to right, each encountered digit N (0 to 9) must be replaced with the character which is N+1 positions before it. Example The input string "Prog2am0in6" would be decoded this way: Hence, the expected output...
Your task: given an integer n, generate an embedded hexagon pattern following the below rules, to the nth depth. An embedded hexagon has the basic shape of this: (n=0) __ / \ \__/ Embedded Hexagons n=1 and n=2: ____ / \ \ /\__/ \ \ / \____/ ________ / \ \ \ /\__/ \ \ /\ ...
This is the inverse of Let's do some "deciph4r4ng" In this challenge, your task is to encipher a string. Luckily, the algorithm is pretty simple: reading from left to right, each typical writing character (ASCII range 32-126) must be replaced by a number N (0-9) to indicate that it is the same as the character N+1 pos...
yOu wiLl bE giVen A sTriNg wHich cOnsiSts oF pRintAble asCii cHarActErs. yOu iTeraTe tHrougH thE sTrIng tHen chAnge rAndOM(uNifoRm, 50% cHanCe uPPercAse) lEtteRs to uPPercAse aNd eVerytHing elSe tO lOwercAse. tHat'S iT. (sorry for the punctuation, it was for the concept of the question) Readable version: You wi...
Note: This is inspired by this question by @Willbeing where task was to count the number of perfect plates of a certain length, but it's slightly different. We call a perfect licence plate that plate whose text satisfies the following conditions: It consists of characters, which can either be uppercase letters([A-Z])...
When using Markup, like on the SE network, an indentation of four spaces before a line of text denotes it as part of a code block, as I hope you know. If you don't, here's an example (with . representing a space): ....Code ....More code results in Code More code The problem is, when you copy-paste code into an answer,...
This challenge is a prize for ais523 for winning the "Rookie of the Year" category in "Best of PPCG 2016". Congratulations! BackFlip is an esoteric programming language made by user ais523, who has created well over 30 other interesting esolangs. BackFlip is a 2D language like Befunge or ><> where the instruction poin...
Backstory I've always found it quite annoying how some numbers in English don't have the same number of syllables even though they have the same number of digits. Example: seven has 2 syllables whereas all of the other digits have one (other than zero). So, when I'm counting in time to something (like a drill cadence i...
Introduction Forte is a very peculiar esoteric language based on the concept of modifying the values of numbers. In Forte numbers are not constants but variables, you can use the LET instruction to assign new values to them. For example, after executing LET 2=4-1 from now on 2 assumes the value of 3, which means that w...
Who doesn't like to chill on a Sunday morning in summer with a chilled beer and TV or in winter playing badminton or ultimate with friends? I always think knowing how many days you have to chill in a month keeps you well-informed and helps you plan what you want to do. Be it sitting in front of your pc and solving a co...
Backstory [which is not true] A piano is set up like this: However, on my piano, all of the black keys are broken! I still want to be able to play some chords on my broken piano though. In music, a chord is a group of notes that are played together. To allow for input of chords, I will first define what a semitone is....
This challenge carries a bounty of 200 points for the first to answer and remain unbeaten for at least 3 days. Claimed by user3080953. There's a lot of talk lately about end-to-end encryption, and pressure on companies to remove it from their products. I'm not interested in the rights-and-wrongs of that, but I wonder...
Given a binary number, your task is to create a 'branch' of that number, with a depth of 2. For example, given 0 as input, you should output exactly this: /000 /00 / \001 0 \ /010 \01 \011 This should be fairly self explanatory of how the branches should be created. Depth 2 means we calculate branc...
Several years back, Hot Wheels made a simple flash game called "Formula Fuelers Racers"*. To play the game, you select three ingredients from a fridge to put into your car, which is then raced against the computer's randomly-generated car. It turns out the mechanics of this game are pretty simple. First off, the act...
Introduction For those not familiar with steam - or at least this particular aspect: Often on peoples' profiles, people leave comments saying either "+rep _____" or "-rep _____". These are an unofficial means of showing whether you think someone in the community has a good or a bad reputation, for a number of reasons. ...
From the Wikipedia article: Location arithmetic (Latin arithmeticæ localis) is the additive (non-positional) binary numeral systems, which John Napier explored as a computation technique in his treatise Rabdology (1617), both symbolically and on a chessboard-like grid. What? Location numerals is a way of writing numb...
Given an ascii-art road and the time it took me to cross it, tell me if I was speeding. Units Distance is in the arbitrary unit of d. Time is in the arbitrary unit of t. The road Here is a simple road: 10===== The 10 means 10 d per t. That is the speed limit for the road. The road has 5 =s, so its d is 5. Therefore, i...
Your task: given a number n, generate a '+' sign that is n characters away from its center. If this is confusing, check out the test cases. Standard methods of input: output must be a string or printed. Standard loopholes apply. Input: 1 Output: + ] 1 away from center `+`. Input: 2 Output: + ] 2 a...
Title misspelled on purpose. Read more to find out why. Your task: given a delimited string or list including the characters A,B,C,D, output the indexes of all the adjacent equal characters. Output can be multiple strings/integers on multiple lines, a list/array, or a delimited string. All output should be in a list or...
In the old DOS operating system, a number of characters were provided to draw boxes. Here is a selection of these characters and their code points: B3 B4 BF C0 C1 C2 C3 C4 C5 D9 DA │ ┤ ┐ └ ┴ ┬ ├ ─ ┼ ┘ ┌ You can use these characters to draw boxes like this: ┌─────────┐ │ │ └─────────┘ Boxes can be at...
Draw a simple ASCII art image containing a straight line. It's similar to this and this but with different specifications. Input You can modify this input format to suit your code. integer width integer height integer x0 integer y0 integer x1 integer y1 Output A filled ASCII art image of the specified width and heigh...
Hexagonal chess describes a family of chess variants played on a board where the cells are hexagons instead of the traditional squares. There are many such variants; in this challenge we'll be focusing on Gliński's variant, which is the most common. The board is composed of three colors (so that the same color doesn't ...
You must make a polyglot that outputs the square of the input in one language and the square root of the input in another. The shortest answer in bytes wins! You must have a precision of at least 3 decimal places, and the input will always be a positive float.
Here's the phonetic alphabet: Alfa Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliett Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey X-ray Yankee Zulu In the fewest bytes possible: Input will be these words in a random order, with the first letters removed. Your goal is to...
Background As most PPCG regulars will know, a quine is a program which outputs its own source code when run; and the Levenshtein distance between two strings is the minimum number of insertions, deletions, and edits needed to change one string into the other. In this challenge, we're combining the two concepts into a "...
Convert a hexadecimal number (of any size) into a binary number. Input A POSITIVE hexadecimal number with a 0x in the beginning. A valid input will always match the following regex: 0x[0-9a-fA-F]+. If the input is not a valid hexadecimal number, that is, anything not matching this regex, the output should be 0. Output ...
Write a program or function with the following functionality: The program/function first attempts to write the string Hello, world! to the standard output stream. (No other forms of output are acceptable for this challenge, as the focus is very much on the I/O rather than the trivial behaviour of the program itself.) ...
Challenge Given a list of SI base units, a list of equations and a target, you must derive the units of the target using only the base units. Derived Units From Wikipedia: The International System of Units (SI) specifies a set of seven base units from which all other SI units of measurement are derived. Each of these ...
Write a program that is a polyglot in three languages that plays rock–paper–scissors. The input for any version of the program is always one of the strings rock or paper or scissors. In the first language the program must output the rock–paper–scissors choice that beats the input: Input Output rock paper paper...
Recently I posted a question about Diffy games which has gone unanswered. Thats fine, the question is really hard, but I would like to make an easier question about Diffy games so that we can get the ball rolling. How Diffy works Copied from Find Diffy Games The Diffy game works like as follows: You start with a lis...
I am trying to use C# to find the index of the first 1 (right to left) in the binary representation of a number. For example, since 100 in binary is: 0b1100100 The first 1 is in the third position from the right, so it should yield 3. 234 should yield 2, 0 should yield 0, etc. Here is my current solution: k < 1 ? 0 :(...
Print the dates of all the Sundays in 2017 in the following format : dd.mm.yyyy. Expected Output: 01.01.2017 08.01.2017 15.01.2017 22.01.2017 29.01.2017 05.02.2017 12.02.2017 19.02.2017 26.02.2017 05.03.2017 12.03.2017 19.03.2017 26.03.2017 02.04.2017 09.04.2017 16.04.2017 23.04.2017 30.04.2017 07.05.2017 14.05.2017 21...
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 ...
The rundown Create a program that generates an array of random length with random numbers, then apply a series of rules that alter the array. After the rules have been applied, print the sum of the array unless specified otherwise Array setup The array must be a random length between 5 and 10 inclusive, with random int...
Task Basically you have an array of random integers e.g. I() = [1, 4, 3, 2, 5, 3, 2, 1] and you have to create another array of the same length with the numbers 1 to the size of the array in place of the smallest to largest numbers respectively, e.g. O() = [1, 7, 5, 3, 8, 6, 4, 2] For duplicates, the first occurrence...
Challenge Given an input of an integer, \$n\$ (where \$0<n<50\$), output the graph of \$y=\mathrm{Re}((-n)^x)\$ from \$x = -3\$ to \$x = 3\$ inclusive. Where \$\mathrm{Re}(p)\$ is the real part of the complex number \$p\$. Note that \$\mathrm{Re}((-n)^x) = n^x \cos{(\pi x)}\$ Output The output may be in any form you wi...
In this challenge, you will be given a square matrix A, a vector v, and a scalar λ. You will be required to determine if (λ, v) is an eigenpair corresponding to A; that is, whether or not Av = λv. Dot Product The dot product of two vectors is the sum of element-wise multiplication. For example, the dot product of the f...
The bus driver picks up the children from their homes every morning for school. All the homes are positioned around a circular street and the bus driver has to stop at every home exactly once. One monday morning the bus driver decided to only pick up every second child he encountered along his way. However, he still ha...
I heard somewhere that one thing that technology cannot do yet is fold towels1. So it is now your job to prove that statement false! Given a string as input, made up of rectangles (towels), like the following, fold each towel in half twice. For example: +------+ +------+ +--+ | | | | | | ...
Your challenge is to write a program, function, etc. that calculates if the passed string is "in order". That means that the characters of the string have character codes that are in order from smallest to largest. The smallest char code must be the first. By that I mean lowest unicode codepoints to highest. It doesn'...
No, not the ^^vv<><>BA kind of Easter eggs, real Easter eggs that we paint. Here is an (awfully drawn) egg. __ / \ / \ | | \____/ In easter, we paint them with patterns. Like these: __ /--\ /----\ |----| \____/ __ /%%\ /%%%%\ |%%%%| \____/ __ /~~\ /~~~~\ |~~~~| \____/ The challenge Given a chara...
Given a string that is one of the directions on a 16-point compass rose output the two directions that are immediately adjacent to the input direction, in clockwise order. Specifically, you need to handle these (and only these) input/output pairs: Input Output N NNW NNE NNE N NE NE NNE ENE ENE NE E E ...
Your program / function, etc. will take 2 inputs. The first will be a list of who came to my party and when. Example: Kevin 13:02 Ruby 5 Sam 3 Lisa 6 Bob 12 What does that mean? It means that Kevin got to my party first (at 13:02, 24-hour time), then Ruby 5 minutes later, then Sam 3 minutes later, then Lisa ...
This is a fewest-operations challenge where the objective is to sort a vector into ascending order using the fewest reversals. Your algorithm can only sort the vector using "sub-vector reversals"1, but it can use other operations for arithmetic operations, loops, checking if it's sorted etc. The number of sub-vector re...
Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them. Rules Your program will receive a positive integer n, as well as a string s with length at least one consisting of only printable ASCII (not including whitespace). The string should then be ...
Recently, I have found my reputation changing time to time. I would like to know my reputation changing real-time. The job Given an id of a user on PPCG (ex.64499), Print the user's reputation every 10 seconds. You may ignore the daily quota. Examples 64499 3808 40695 Possible output format 12345 12,345
Given an audio file, determine whether it is encoded in a lossy format or a lossless format. For the purposes of this challenge, only the following formats need to be classified: Lossy AC3 AMR AAC MP2 MP3 Ogg Vorbis WMA Lossless AIFF FLAC TTA WAV Rules If input is taken in the form of a filename, no assumption...
Challenge Given three numbers \$a\$, \$b\$, and \$n\$, you must expand \$(a + bx)^n\$ in ascending powers of \$x\$ up to \$x^3\$. Binomial Expansion Note that this method is an approximation The binomial expansion works like so: (a + bx)^n = a^n(1 + bx/a)^n = a^n(1 + n(bx/a) + n(n -1)(bx/a)^2/2! + n(n-1)(n-1...
Many different types of train set exist, ranging from wooden tracks like Brio, to fully digital control perfect tiny metal replicas of real trains, but they all require a track to be designed, ideally using as many of your pieces as possible. So, your task is to determine whether, given input of the available pieces, i...
Your task: given an integer n, output an embedded triangle to the nth depth. Standard methods of input and output, input in any convenient format, output should be as a string. Examples are 0-indexed, you can use 1-indexed if you want. Standard loopholes apply The left and right sides of each figure is 2^n, when 0 inde...
Gödel's β function takes three natural numbers as arguments. It is defined as β(x,y,z) = rem(x, 1 + (z + 1) · y) = rem(x, (z · y + y + 1) ) where rem(a, b) denotes the remainder after integer division of a by b. The β Lemma now states that: For any sequence of natural numbers (k_0, k_1, … , k_n), there are natural nu...
Problem adapted from the book Fortran 77 by Donald M. Monro Introduction Digital plotting machines are widely used to produce various forms of drawings, graphs and other pictorial results. Most such machines can move their pens only in certain directions, usually as single steps in the X and Y direction or both. A typi...
Titin is a protein found in muscle tissue. It is a pretty big protein, and its full chemical name is giant as well. Comprising 189819 characters, the full name of titin would take about 3.5 hours to pronounce. Your task is to output this entire name! Details The full name can be found here: Gist (this file does not inc...