instruction
stringlengths
34
53.1k
Rod is moderating a card game between two players: George and Tim. Currently, Tim is shuffling the cards. Rod suspects that Tim is trying to cheat, so he needs your help to check that the shuffle is fair. Tim is doing the overhanded shuffle: he cuts a pile of cards from the bottom of the deck, then cuts various parts f...
Consider a string of length N, such as Peanut Butter with N = 13. Notice that there are N-1 pairs of neighboring characters in the string. For Peanut Butter, the first of the 12 pairs is Pe, the second is ea, the last is er. When the pairs are mostly different characters, the string has a chunky quality, e.g. chUnky. W...
+--+ +--+ | | +--+ +--+ | | | | | | | | +--+ +--+ +--+ +--+ The people of ASCIIville are rebuilding their city and are sketching out new blueprints. Your job is to draw their new city based on how many buildings they want. The input will be how many buildings there are. Each building is half the hight of th...
It can be in any language, plus the map must be in the output only not in the source code. This is my first question here, so please feel free to edit it. Also, there might be some rules about scoreboard which I'm not familiar how to put it here. Cheers!
Consider a triangle ABC where each side has integer length (an integral triangle). Define a median of ABC to be a line segment from a vertex to the midpoint of the opposing side. In the figure below, the red line segments represent the medians. Note that any given triangle has three medians. Let n be some positive int...
1300 years ago, the English theologian Bede earned the honorific by which he is now known ("The Venerable Bede") by, among other things, convincingly computing the date of Easter for a number of years. This required reconciling the old, Jewish, lunar calendar with the newer solar one, a task made all the more challengi...
The goal of this challenge is to implement a storage and retrieval pattern that will most quickly determine if a set of recurrence definitions fall within a date range. Consider the schema: Event -|--has one or many--<- Schedules Schedule is a record defining a recurrence, e.g. (these are just samples) Monthly, every...
Write a program that takes in a string or text file whose first line has the form width height and each subsequent line has the form x y intensity red green blue where: width and height may be any positive integers. x and y may be any integers. intensity may be any non-negative integer. red, green, and blue may be a...
Garland Words A garland word is a word which can be strung together like a garland, because it ends with the same letters it starts with. These groups of letters can even overlap! For example, underground is a garland word of order 3, because it starts and end with the same 3 characters, und. This means it could be st...
Using the following table (source) write some code that takes the names of two planets and returns the distance between them: +-------------------+---------------+ | Planets | Distance (km) | +-------------------+---------------+ | Mercury -> Venus | 50290000 | | Venus -> Earth | 41400000 | | Ea...
Given a matrix M all of whose entries are 0 or 1, we want to known whether there exists a non-zero vector v with each element in {-1, 0, 1}, such that Mv = 0. An easy way to do this is just to try all possible vectors v. The M is m by n then there are 3n - 1 such vectors. But of course this is PPCG, so we don't want...
Consider 30 by 30 Toeplitz matrices all of whose entries are 0 or 1. This challenge is a simple optimization challenge to find the matrix with the largest determinant possible. Input None Output A 30 by 30 Toeplitz matrix all of whose entries are 0 or 1 along with its determinant. Score The determinant of the matrix y...
Introduction In this game, players use their armies to fight other players' armies, capture territories, and become the last man standing. Each turn, players receive a base number of armies to use at their disposal. By capturing territories in certain regions, however, players can increase this number to give them a po...
Background PICASCII is a neat tool that converts images into ASCII art. It achieves different degrees of brightness by using the following ten ASCII characters: @#+';:,.` We'll say that these charxels (character elements) have brightnesses from 1 (at-sign) to 10 (space). Below, you can see the results of converting a...
This question will feature a mechanic from the game "Path Of Exile" in this game there are things called MAPS they are items that you can use to open high level areas, you can also combine 3 of them to get a upgraded one which will be the task of this challenge. The upgrade combinations are as follow: A Crypt Map 68 ->...
An Abjad is a writing system where each symbol stands for a consonant, and where vowels are omitted. An impure Abjad is an abjad in which there are additionals symbols for vowels, usually diacritics. Write a program or function that, given a string of lowercase text (i.e. nothing but ASCII letters from a to z, commas a...
In Talos Principle, from time to time player has to solve a puzzle that looks like this: Source: http://uk.ign.com/wikis/the-talos-principle/File%3A20141108_134749.jpg This puzzle is already solved - the blue slots on the right are the list of the possible blocks the user could use. They were placed in the grid so tha...
This is a challenge about the the tricks and optimizations that can be used when golfing in Pyth. Pyth golfers may recognize many of the tricks involved. However, unfamiliar approaches and constructs may be involved, so take a look at the Pyth Tips as well as the Pyth Character Reference if you get stuck. Solutions ma...
The standard long addition method: The standard algorithm for adding multidigit numbers is to align the addends vertically and add the columns, starting from the ones column on the right. If a column exceeds ten, the extra digit is "carried" into the next column. (wikipedia) A long addition example: 145 + 98 ----- ...
When coding in Python, sometimes you want a multiline string within a function, e.g. def f(): s = """\ Line 1 Line 2 Line 3""" (The backslash is to remove a leading newline) If you try to actually print out s, however, you'll get Line 1 Line 2 Line 3 That's not what we want at all! There's...
Given a WxH grid, how many possible mazes are there? Things you know about the maze: The grid is exactly H squares high and W squares wide. There are three types of squares: Start, Finish, and Empty. Your maze must contain exactly 1 Start and 1 Finish, and all remaining squares are Empty. There are walls surrounding ...
The SKI calculus is a variant of the Lambda calculus that doesn't use lambda expressions. Instead, only application and the combinators S, K, and I are used. In this challenge, your task is to translate SKI terms into Lambda terms in β normal form. Input Specification The input is an SKI term in the following textual ...
Write a program that takes in a string containing only spaces, newlines, and angle brackets: <, > (chevrons). Output a string of spaces, newlines, and slashes: /, \ (soliduses) whose shapes correspond to the input, but rotated a quarter turn clockwise, with a column of spaces inserted between each row of the original i...
The following challenge is basically a simpler version of the one proposed by Dennis (Lossy ASCII art compression). I found the idea super interesting but a bit too convulted, and seeing as it didn't seem to be getting much attention I decided to modify it a little bit. You'll be downloading 5 ASCII art text files, eac...
What is the shortest C# statement that will convert a string representation of a number to an int[] that contains each digit? string number = "1234"; number.Array.ConvertAll(line.ToCharArray(), c => Int32.Parse(c.ToString())); number.ToCharArray().Select(i => Convert.ToInt32(i.ToString())).ToArray(); number.Select(i =>...
Intro: I remember, when I was a kid, I would get a calculator and keep on pressing the + button, and see how high I could count. Now, I like to program, and I'm developing for iOS. Counting is a fundamental skill for both humans and computers alike to do. Without it, the rest of math can't be done. It's done simply by ...
Summary Inspired by the recent popularity of ASCII art challenges, this challenge's purpose is to draw an ASCII checkerboard, like one on which Chess can be played. Write a program that takes a positive integer n as an argument, in stdin, or as user input, and output an checkerboard with nxn squares, along with a borde...
Pronouncing Hex For those of you uninitiated with the show Silicon Valley, this challenge is inspired by an exchange that goes like this (YouTube): Kid - Here it is: Bit… soup. It’s like alphabet soup, BUT… it’s ones and zeros instead of letters. Erlich Bachman - {silence} Kid - ‘Cause it’s binary? You know, b...
A maze on an N by N grid of square cells is defined by specifying whether each edge is a wall or not a wall. All outer edges are walls. One cell is defined as the start, and one cell is defined as the exit, and the exit is reachable from the start. The start and exit are never the same cell. Note that neither the start...
Your task is to solve the Longest Common Subsequence problem for n strings of length 1000. A valid solution to the LCS problem for two or more strings S1, … Sn is any string T of maximal length such that the characters of T appear in all Si, in the same order as in T. Note that T does not have to be a substring of Si. ...
For your hard thing to do, you must make a thing for a computer to do that finds out if some words are explained in a simple way. Something is explained in a simple way if it only uses the ten hundred most used words. If not, it is explained in a hard way. This can be a full computer thing or part of a computer thing. ...
You should write a program or function which receives an integers as input and outputs or returns two integers whose sum is the first one. There is one further requirement: no number can be part of the output for two different inputs. Details You should be able to handle inputs for at least the range -32768 .. 32767 (...
In addition to contributing to Stack Overflow and other SE sites, I like to ride public transit during my free time. I'd be spending a fortune on cash fare and/or bus tickets every month if I didn't have a bus pass. But for the average passenger, how much would you need to ride to make it worthwhile to buy a pass? Inpu...
The Fibonacci sequence is a well known and famous sequence, where each successive element is the sum of the previous two. A modular Fibonacci sequence is the same, except that the addition is performed over a finite field, or to put it another way, a modulo operation is performed after each addition. For instance, the ...
This is a mini golf hole: The outer boundary is a circle with radius 10 and center (0,0). The inner boundary is a circle with radius 3 and center (0,5). The tee is at (0,-8). Assume the ball is just a point with radius 0. The dynamics of the ball are governed by the following rules: The ball is initially hit with ene...
Knockout is a basketball game where players take turns shooting. It is played as a sequence of two-player contests, each of which has the possibility of "knocking out" one of those players. Suppose the players are A B C D and their chances of shooting and making a basket are 0.1 0.2 0.3 0.4 respectively, independently ...
Inspired by this question earlier today, I'd like to see interesting ways various programming languages can turn a numpad into probabilities. Commonly, tile-based games will allow you to use a numpad to move in any direction based on where your character currently is. When making an AI for these games, Math.random() * ...
Your goal is to generate a Fibonacci spiral with numbers. Example Input / Output 1 -> 1 2 -> 1 1 3 -> 1 1 2 2 2 2 6 -> 8 8 8 8 8 8 8 8 5 5 5 5 5 8 8 8 8 8 8 8 8 5 5 5 5 5 8 8 8 8 8 8 8 8 5 5 5 5 5 8 8 8 8 8 8 8 8 5 5 5 5 5 8 8 8 8 8 8 8 8 5 5 5 5 5 8 8 8 8 8 8 8 8 1 1 3 3 3 8...
Instead of normal binary, you must count from 1 to an input in negabinary concatenated to negaquaternary. Here's an example, put in the form of an array: [11, 1102, 1113, 100130, 101131, 11010132, 11011133, 11000120, 11001121, 11110122, 11111123, 11100110, 11101111, 10010112, 10011113, 10000100, 10001101, 10110102, 101...
The Borromean rings are a curious set of three circles, linked such that the removal of any one of them will unlink the other two: You can make a set for yourself with a couple rubber bands and a binder ring. With more rubber bands, it's easy to make any Brunnian link. Write a program or function that outputs (prints ...
Recently there was a question on Stack Overflow where the OP was trying to write a function to find the word in a string that has the most repeated letters. It is of course not hard to write one up in seconds, and I wrote one in Javascript as short as I can for fun. But I'm not an expert in code golfing, so I wonder ho...
(Note: I know that the VSEPR method fails sometimes, and that there are exceptional molecules. The challenge is about the molecules which conform.) Most people who have taken an introductory chemistry course know about molecules, and (probably) the VSEPR theory of chemical bonding. Basically, the theory predicts the ...
A friend of mine got this question during an interview. The interview ended with no luck for him, but still, we're very curious to hear the solution. The question is as follows: Modify the code below (change 3 lines maximum) so the function will return the length of the longest sequence of the same bit, if you would fl...
You have a box with a single digit number in each corner: 1|2 --- 3|4 If we concatenate the digits along rows left to right, we get 12 and 34. If we concatenate the digits along columns top to bottom, we get 13 and 24. If we add all of these numbers, we get 12+34+13+24 = 83. Challenge Write a program to print all such...
Revised formatting and instructions Given a list of moves for a Cracker Barrel peg board game, or as @Steveverrill stated, Peg Triangle Solitaire: Game 1 Game 2 Game 3 1: 0 ,-1, -1 C, -1, -1 4, -1, -1 #starting point 2: 3, 1, 0 3, 7, C B, 7, 4 #jump_from, jump_over, jump_to 3: A, 6...
C++ implements a Turing-complete functional programming language which is evaluated at compile time. Hence, we can use a C++ compiler as an interpreter to run our metaprogram without ever generating code. Unfortunately, static_assert won't allow us to emit our result at compile-time, so we do need* to generate an exec...
The Simpson index is a measure of diversity of a collection of items with duplicates. It is simply the probability of drawing two different items when picking without replacement uniformly at random. With n items in groups of n_1, ..., n_k identical items, the probability of two different items is For example, if you ...
You should write a program or function which receives a list of digits as input and outputs or returns the largest sum achievable by putting these digits in a square. Input will always contain a square number of digits. An example square arrangement for the input 9 1 2 3 4 5 6 7 7 could be 677 943 125 The sum is calcu...
This is the first problem I've posted here; please post criticisms in comments. Summary A game board consists of a starting space, an ending space, and between them are N spaces, each with an instruction. You begin on the starting space with 0 points to your credit. Flip a coin or roll a die to choose the number 1 or 2...
While moving, I broke my lamp. Now, I need a new one. It's your job to make me a lamp! I'm not sure what size I want, though I know I want a squiggly one. Your program/function must take in a number input, and print out a lamp with that many squiggles/bumps. Examples: Input:2 Output: /--\ () () /__\ Input:3 Output:...
We live in a wonderful age of technology where we can have beautifully detailed 8K screens on our TVs, and even 2K displays on our phones for our mobile browsing pleasure. We've come a long way in recent years in terms of screen technology. One of the products of this is a term that was made popular by Apple, Retina. ...
Write a program that takes in a string where every line consists of the character 0 indented by some number of spaces. The top line is not indented and every other line will be indented by at most one more space than the line just before it. No lines will have trailing spaces but you may optionally assume there is a si...
You must write a program that encrypts an input into a string of characters. For every character i in the input up to the second to last character, take the i and i+1 characters and encode them by writing the letters of the alphabet, in order, that range in the same direction between those chosen characters. For examp...
Average color of an image Scientists have been able to determine the average color of the universe but in how many bytes can we find the average color on an image? Your task Your input will be a single image which you will need to find the average of the colors in the image and output a hex color-string (#??????). The ...
Your Goal: Estimate pi to at least 10 decimal places. The format is your choice - it can output as a number, as a string, as an output to STDOUT, etc. Seems easy, right? But wait, it's not as simple as it seems... The Rules: You get exactly 10 function calls (this includes operators). These functions cannot be ones tha...
Some characters are more holy than others. Using as few unholy letters as possible, display the statement above. Challenge Write a full program to print Holy Hole In A Donut, Batman! to STDOUT or closest alternative. If you can compress the input to reduce your score, go wild :) Input None Output Holy Hole In A Donut, ...
The task is to compute the divisor sum of a number given its prime factorisation. Input Two arrays (or something equivalent) of length n, one containing the prime factor and the other containing the corresponding exponent. Output The sum of all divisors (including the number itself). Example The number 240 has 2, 3, an...
Your Task Given a list of words, check if they form a valid word grid. They form a valid grid if there are N words with N letters and they spell the same words vertically as they do horizontally. The words can be given in any order. [FILE, ICED, LEAD, EDDY] = True and [FILE, LEAD, EDDY, ICED] = True. Print True if it i...
This is a simple challenge: Given a sequence of integers, find the sum of all integers in it. But with a twist. Your score is the Levenshtein distance between your code and the following phrase (The challenge): Given a set of integers, find the sum of all integers in it. You may assume there are no newlines or traili...
Write a program that takes in a standard truecolor image and a single 24-bit RGB color (three numbers from 0 to 255). Modify the input image (or output a new image with the same dimensions) such that its average color is exactly the single color that was input. You may modify the pixels in the input image in any way yo...
A function (or program) which takes inputs and provides outputs can be said to have a cycle if calling the function on its own output repeatedly eventually reaches the original number. For instance, take the following function: Input: n 1 2 3 4 5 6 Output: f(n) 5 7 1 3 4 9 If we start with n=1, f(n)=5, f(f(n))=f(5...
This is a sequel to this challenge: Code close to the challenge: Sum of integers The challenge in this one is a bit harder, and also makes for a cool title (Which is why I picked it): Calculate the Levenshtein distance between two strings Just like last challenge, your score in this challenge is the Levenshtein dista...
This is the followup question to this previous CodeGolf question about Covering Arrays (the details of what Covering Arrays are and how they are formatted at the NIST website are there). In this challenge, we won't just be validating covering arrays - we will try to minimize them. Finding minimal Covering Arrays, in ge...
Background A question wanted to solve a problem in a way that made it unreasonably complex: https://stackoverflow.com/a/31551257/29347 The problem in the original question is: Take a list of (key, value) and produce a dict such that {key: sum(value)} My Problem I want to use dict compression with list.count or str.c...
Task Your task is to produce string that contains average characters of string. First character of result would be average character of first character (which is first character) and second character average of two first characters and so on. What is average character? Strings are arrays of bytes. Average character of ...
I'm a huge video game music fan. One of my favorite OSTs is that from Kingdom Hearts, by Yoko Shimomura. The challenge Create a program or function that takes two arguments in any format: an abbreviated Kingdom Hearts game and a boss in that game. It must return the name of the song that plays for that boss. The progra...
Through the bases In this challenge, you will be taking a number through all the bases of the rainbow Given an input, n, you will output n in every base from 9 to 2, and back up to 9. That's 9 8 7 6 5 4 3 2 3 4 5 6 7 8 9. Example: >>> 16 17 20 22 24 31 100 121 10000 121 100 31 24 22 20 17 Rules: You input can be a s...
In the game Hearthstone there is a playing board containing friendly and enemy minions, and two heroes - yours and the enemy's. To generalize and simplify, we will assume it's your turn, the opponent has 0-7 minions with given health values on the board, and is at H life points. We will ignore our side of the board ent...
So, blatantly plagiarizing from inspired by this challenge and its sequel, I thought I'd add another. The text to match: What do you get when you multiply six by nine The result your function/program/etc. should print or return: 42 An online calculator for Levenshtein distance can be found here: http://planetcalc....
A stretchy snake looks something like this: <||=|||:)~ Each separate sequence of vertical bars (|) in a stretchy snake, known as a stretchy portion, is individually extendable to twice its width, and is drawn with alternating slashes (/,\) once extended. The particular snake above has two such stretchy portions, givin...
You are a space tourist on your way to planet Flooptonia! The flight is going to take another 47,315 years, so to pass the time before you're cryogenically frozen you decide to write a program to help you understand the Flooptonian calendar. Here is the 208-day long Flooptonian calendar: Month Days Input Range...
Digging around in the depths of your temp folder, you find some compositions for the piano. Unfortunately, these compositions were written with note names and durations only, and you only have access to a text terminal. Therefore, your task is to write a program to display the compositions as ASCII art. Input Your prog...
Synopsis: Given the output of a generalised FizzBuzz program, return the list of factors and words used for the program. Challenge Description Imagine a generalised FizzBuzz program that takes in as input a list of factors and words to use and the number to start from. For instance, if the input of this program was 3...
This is a fairly simple question. According to this random website I found — Web Archive, a reference angle is the acute angle formed by the terminal side of the given angle and the x-axis. You have to write a program to find these. I don't remember anything from algebra 2, what does this mean? Angles are usually given...
I've been scrolling around this site for a while, but just recently got really interested in actually trying out some of the challenges. I was intending to try my hand at some of the existing code-golf topics, but I didn't have Internet access for a while yesterday, and in the meantime, I thought up my own challenge. Y...
The puzzle: Consider a console/hand-held game with a d-pad where you are required to enter a name of sorts. This appeared in many older games before the use of QWERTY was popularised in consoles (e.g. I believe the Wii uses a QWERTY keyboard layout for input). Typically, the on-screen keyboard looks to the effect of*: ...
Implement a CipherSaber encryption program, as described below. Guidelines: The smallest entry, in bytes, wins. However, in a departure from code-golf norms, you are welcome to post interesting entries, even if they aren't serious golf entries. An entry would typically be a program that takes the plaintext from sta...
In as few bytes as possible, write a program or function that outputs the following: Abcdefghijklmnopqrstuvwxyz aBcdefghijklmnopqrstuvwxyz abCdefghijklmnopqrstuvwxyz abcDefghijklmnopqrstuvwxyz abcdEfghijklmnopqrstuvwxyz abcdeFghijklmnopqrstuvwxyz abcdefGhijklmnopqrstuvwxyz abcdefgHijklmnopqrstuvwxyz abcdefghIjklmnopqrs...
The lost pawn problem After the chess game ended, a surviving pawn was left behind enemy lines. let's help him find the shortest way back home. The original problem describes a nXn "chess" board, and a function f: {1,..,n-1}X{1,..,n}X{-1,0,1} => R+ of weights. the goal is to find the best path from some square in the b...
Goal: Write a program or function which prints an input string in a sinusoidal shape. The ASCII sinusoid Here is one period of the sinusoid: ....... ... ... .. .. . . ...
It's very easy: Create a program without writing a single line of code. The code may only consist of existing Stack Overflow questions and answers. The program should create two random numbers and output the numbers added to, subtracted from, multiplied with and divided by each other. Rules You must include lin...
Fannkuch is a classic benchmark program. The name comes from the German "Pfannkuchen"- pancakes- for the algorithm's resemblance to flipping stacks of pancakes. A Fannkuch sequence of numbers is formed as follows: Take a permutation of {1.....n}, for example: {4,2,1,5,3}. Take the first element, here 4, and reverse ...
Introduction After a long battle, you have managed to defeat a Sphinx in a contest of riddles. The Sphinx, impressed with your skill, wishes to give you a reward commensurate with your cleverness, and conjures into existence a strip of magical parchment divided into eight boxes, each containing a numeral. "Crease the ...
your shift key is broken. wheNever you type two lines, the cApitaL LetteRs in them get swappeD. you must write a program to fiX THIS! Description The input is two strings, s1 and s2, equal in length. They will each contain only printable ASCII and be at least one character in length. You may input these as two strings,...
The Knödel numbers are a set of sequences. Specifically, the Knödel numbers for a positive integer \$n\$ are the set of composite numbers \$m\$, such that all \$i < m\$, coprime to \$m\$, satisfy \$i^{(m-n)} \equiv 1 \mod m\$. The set of Knödel numbers for a specific \$n\$ is denoted \$K_n\$. (Wikipedia). For example, ...
The so-called Will Rogers phenomenon describes a way to tweak statistics by raising the average in two (multi)sets when one element is moved between the two sets. As a simple example, consider the two sets A = {1, 2, 3} B = {4, 5, 6} Their arithmetic means are 2 and 5, respectively. If we move the 4 to A: A = {1, 2, ...
This is Calvin. Just trying to get 20 rep so this user can chat in the PPCG Minecraft Server chatroom. Write a program or function that takes in a positive integer. If the integer is even (2, 4, 6, ...), print or return this exact ASCII art string: __ __ __ __ ___ /\ /\ | ...
Mr. Mackey is a South Park character well-known for adding "m'kay" in everything he says. Write a program or function that transforms a string of text into something Mr. Mackey would say. M'kay placement m'kay has a random 50% chance of being added after the punctuations ,, ., ? and !. If that is the case, it will be...
Your mission, if you choose to accept it, is to create a stack that can do basic math operations. Explanation: Your stack must be able to do basic arithmetic (+-*/) and must support normal base 10 numbers (0123456879); numbers will only be one character long. Programming: Input from stdin will be loaded as a program. ...
Censors are a common tool used on the interwebs. But they often censor too much of the word, and thus make the cursing ambiguous to the reader. And sometimes they don't censor enough, so the words still remain offending. Your task is to fix that. Your task Write a program/function/whatever that takes two lists and a st...
My first ever Programming Puzzles & Code Golf is the Seven-Slash Display. Here is my first Challenge, also based on 7-segment display. I often think about, besides numbers, what kind of letters I can display using a simple 7 segment display. Turns out a lot of letters can be displayed. In fact, all but the letters K, M...
Marching Squares is an algorithm from computer graphics, which is used to recover 2D isocontours from a grid of samples (see also, its big brother Marching Cubes for 3D settings). The idea is to process each cell of the grid independently, and determine the contours passing through that cell based on the values at its ...
Challenge Given a number of seconds past midnight, output the smallest angle between any two hands on a clock face, using as few bytes as possible. You may assume that the number of seconds is always less than 86400. Angles may be represented in degrees or radians. A reference solution is at: http://ideone.com/eVdgC0 T...
Write a program that will produce differing behaviors on as many different platforms as you can. Each differing platform awards one point (including an initial platform, meaning you can't score less than 1*). Mechanisms intended for determining the target/executing platform (e.g. through platform compilation statements...
Average out two lists Challenge Given two lists of positive integers, determine whether it is possible to rearrange the elements into two new lists such that the new lists have the same arithmetic mean (average). Input The input can be taken through STDIN or as function arguments. Input can be taken as a list, or if yo...
Goal: Write a function or program that, given an integer n, will output a program in the same language that is a quine with a period of n. Description of Output Program: The output program needs to be a program that, when run, ... will output a program... that will output a program... etc, until the nth program is the ...
figlet is utility that converts plain text to an ascii-art representation for use in banners and the like. For example: $ figlet "CODE GOLF" ____ ___ ____ _____ ____ ___ _ _____ / ___/ _ \| _ \| ____| / ___|/ _ \| | | ___| | | | | | | | | | _| | | _| | | | | | |_ | |__| |_| | |_| | |___ ...
Capacitors are notorious for being manufactured with high tolerances. This is acceptable in many cases, but some times a capacity with tight tolerances is required. A common strategy to get a capacity with the exact value you need is to use two carefully measured capacitors in parallel such that their capacities add up...
You should write a program or function which receives the volume of a bowl and the volume of the water in it as input and outputs or returns an ASCII representation of a bowl with water in it with the desired volumes. A bowl has the following structure: \ / \___/ The bowl has at least one _ character. The count...
This is a fairly simple code golf challenge. Your program, given an ASCII string, is to parse that string into two strings, which it will evaluate. If the second string is "later" than the first one, it will return a 1, if it is "earlier" than the first one, it will return a -1, and if they are the same, it will return...