instruction
stringlengths
34
53.1k
[Latest update: benchmark program and preliminary resuls available, see below] So I want to test the speed/complexity tradeoff with a classic application: sorting. Write an ANSI C function that sorts an array of floating point numbers in increasing order. You can't use any libraries, system calls, multithreading or inl...
You are to make a program that given a number, such as 22009, will go for example to Pi Calculation Code Golf. Then it will, for each answer, try to figure out what the code is, and count its characters. It will then output, for each answer, its number of characters, and a link to it. It should be sorted with fewest ch...
Definition A positive integer n is a practical number (OEIS sequence A005153) iff all smaller positive integers can be represented as sums of distinct divisors of n. For example, 18 is a practical number: its divisors are 1, 2, 3, 6, 9, and 18, and the other positive integers smaller than 18 can be formed as follows: ...
You have to make a golf game with the following specification :- The field is 10 X 10 characters without spaces. Free ground is represented by . A hole generated at random(not at 0,0) is shown by O (its alphabet and not zero). The ball starts at 0,0 represented by X. You can hit the ball with input d 4 (meaning di...
There are programs that will output its source code to standard output and do nothing else. They also access no external output. This type of program is known as a quine, and is a common code challenge. There are poems that have the rhyme scheme a-b-a-b, c-d-c-d, e-f-e-f, g-g. They have 14 lines. They are usually recit...
Since no one has posted a "good quality question" recently, i feel it is my duty to... Task: You work at an electronics company in the design department. The designers that work with you have asked you to make a program that will calculate the optimum configuration of pins on a microchip they are designing. With your ...
Your task: To write a program that should obviously terminate, but it never (to the extent of a computer crash) does. Make it look like it should perform a simple task: adding numbers, printing something,... But it just gets caught in an infinite loop. Try to make your program very clear and simple, while it actually ...
I once needed to write a function that calculates the block entropy of a given symbol series for a given block size and was surprised how short the result was. Thus I am challenging you to codegolf such a function. I am not telling you what I did for now (and in which language), but I will in a week or so, if nobody ca...
Our closest star, the sun, is quite fidgety. The times it rises and sets depend on where you are, and whether it is winter or not. We would like to be able to deduce if the sun is shining outside without having to leave the comforts of our basements - which is why we need an up-to-date sun map (a.k.a. daylight map). Yo...
Given a POSIX Extended Regular Expression as input, output its complement (also a POSIX ERE). If the given regular expression matches a string, its complement should not match it, and the regex: (regex given)|(complement) should match any string. In other words, negate the regex. The regex for format input and for outp...
Task: Your task is to create two programs in different languages that can communicate one-way to each other. Your sending (tx) program will take input, for either stdin or a query, and send it along to the receiving (rx) program. Your rx program will then print out the data that it receives. Rules: The two programs mu...
What general tips do you have for golfing in Lua? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Lua (e.g. "remove comments" is not an answer). Please post one tip per answer.
SAT is the problem of determining whether a boolean expression can be made true. For example, (A) can be made true by setting A=TRUE, but (A && !A) can never be true. This problem is known to be NP-complete. See Boolean Satisfiability. Your task is to write a program for SAT that executes in polynomial time, but may no...
What general tips do you have for golfing in Julia? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Julia (e.g. "remove comments" is not an answer).
Seeing as its St. Patrick's day, I thought I would have a little challenge Your task is to write a program draws a clover in any way possible. Each leaf has to be symmetrical, and the user has to input the number of leaves that they want on the clover. It then must be drawn. This has to be generated. You cannot just lo...
The goal is to animate a star exploding in ASCII art, starting from a single star character * to a supernovae and finally to the space void. Rules : You have to display only 80 characters per line on 24 lines (this is the default terminal size on Linux) Only these 95 printable characters from ASCII are allowed Steps: ...
Compare if three string variables with the same content, return true if they are or false if they are not without using conditional operators and bitwise operators. e.g. in C# without && || ?: return (string1==string2)==(string1==string3)==true; PS: initial idea came from these question
Chomp is a two-player game with a setup of a rectangle of pieces. Each player takes a turn removing any piece, along with all pieces above it and to its right. Whoever takes the bottom-left piece loses. It can be proven fairly easily that the first player always has a winning move (except with a 1-by-1 rectangle); find...
Your task is to create a memory leak. This is a program that uses loads of memory, until the computer runs out and has to do some swapping to save itself from running out. The only way that the memory can be released is by killing the program in the task manager or using a command line kill such as taskkill /im yourpro...
Prove anti-virus software is paranoid by making a program that simply opens and alphabetically sorts a CSV file, that will get flagged as a virus (or malware/spyware/any threat really) when run. You will be assessed by the following criteria: Does the cross-platform anti-virus package ClamAV detect it as a threat? You...
You must generate an text stereogram according to an input string containing a paragraph of text, an empty line then the hidden message. The result will be displayed as a pair of paragraphs, one with different spacing causing the effect of it being raised up when viewed stereographically (An explanation can be found he...
Your challenge is to divide two numbers using long division. The method we used to use in old days of school to divide two numbers. Example here You should NOT use / or any other division operator in your code. Also, this is not ascii-art Example: Input : 4 2 (4 divided by 2) Output : 2 0 (here 2 is quotient an...
My dog is barking at me, but I'm too lazy to take him for a walk. I have an idea! I'll get the people at Code Golf to do it for me! Your challenge is to simulate a dog's walk. Here are the rules for walking the dog: The human (H) will start at 0,0 on a (Cartesian) coordinate plane, and will randomly go one space eithe...
Suppose we define an infinite matrix M, on N^2 -> {0, 1} (where N starts from 1 instead of 0) in this manner: M(1, 1) = 0. For every x > 1, M(x, 1) = 1 if x is prime, and 0 otherwise. For every y > 1, M(1, y) = the yth term in the Thue-Morse sequence. For every x, y > 1, M(x, y) = M(x, y-1) + M(x-1, y) mod 2. The top...
Inspired by xkcd. Your challenge is to determine whether a number would make a good combination in the game 2048. Your input will be a number, such as: 8224 And the output will be whether that number would make a good 2048 combo, which for this input would be true or yes or 1 or any other way of indicating a positive ...
Write a quine with 1 or more rhyme scheme from http://en.wikipedia.org/wiki/Rhyme_scheme when read. The following characters are spoken aloud: any alphanumeric words or characters not in a comment; comparison and arithmetic characters (+ plus; - minus; * times, / divided by, | or, || or, & and, && and, ! not, = equals...
The code should take text from standard input: The definition of insanity is quoting the same phrase again and again and not expect despair. The output should be a PNG file containing the word cloud corresponding to that text: The above word cloud was created using a specialized online application and it filtered the...
The determined Real Programmer can write Fortran programs in any language. from Real Programmers Don't Use Pascal Your task is to write program in your programming language of choice, but you are allowed to use only another language. That is, throw away all coding conventions from one language and replace them with c...
Input The first line will be a certain string repeated any amount of times. For example, it could be abcabcabcabc, [];[];[];, etc. It may be cut off; for example: 1231231231. Always find the shortest string; for example, if the line is 22222, then the string is 2, not 22 or 22222 or anything else. The string will alway...
The "problem" Define a function log (or other 3 letter name) which when called will log/print/write (whatever is the default for the language in question) both the instruction (as source) and the first argument. In other words: i=777 j=333 log(i) //outputs: "log(i) 777" log(i+j+1) //outputs: "log(i+j+1) 1111" For all ...
There seems to be this ongoing craze about people tediously learning new keyboard layouts like Dvorak or Neo because it supposedly makes them more productive. I argue that switching keyboard layouts is a bad idea, because it can take you months to get up to speed, and when you're finially 5% faster than the rest, you'r...
As we all know, limericks are short, five-line, occasionally-lewd poems with an AABBA rhyming scheme and an anapestic meter (whatever that is): Writing a Limerick's absurd Line one and line five rhyme in word And just as you've reckoned They rhyme with the second The fourth line must rhyme with the third You...
Create a program which gets an input from the user and tells the user what repetitions exist in the it. A few examples of inputs the user could give and outputs they should get: Input: 112211221122 Output: 1122 * 3 Or: Input: 123123 Output: 123 * 2 Or: Input: 1234 Output: No repetitions found! Tiebreaker: if your...
Here are the letters of the English alphabet in order by frequency: e t a o i n s h r d l c u m w f g y p b v k j x q z That is, e is the most frequently used letter, and z is the least common. (Data from Wikipedia.) Your challenge is to take some ROT-n'd text, such as: ocdndnvqzmtnzxmzohznnvbzocvodnqzmtnzxpmzviynvaz ...
In this task, you are allowed make an useful program to do anything you can write within 100 characters. You are allowed to use less characters, but not more. Rules, just to protect from standard loopholes that are no longer funny: Your program cannot access the internet, unless it really has to. For example, the prog...
The zombie apocalypse has come, and the world is coming to an end. Suddenly, someone discovers a formula that takes the current hour, minute, and day, and spits out the perfect note to play on a piano that instantly kills every zombie that hears it. Unfortunately, there is only one piano player left in the world, and h...
Input The symbol of any triadic chord (see http://en.wikipedia.org/wiki/Chord_(music)#Triads). Output The notes constituting the given chord. Examples Input: AM Output: A C# E Input: C#m Output: C# E G# Input: Db+ Output: C# F A Input: C0 Output: C D# F# Bonuses -50 if you can also deal with seventh chords -150 for act...
This is not a Sudoku solver, nor a Sudoku checker. Your challenge is to write a function or script that, given as input the "block" size of a 2D Sudoku puzzle (which is 3 for the classic 9x9 board, 4 for a 16x16 board, etc.) will compute an approximation of the number of distinct puzzles (solutions) that exist for that...
A boolean circuit in TCS is basically a DAG consisting of And, Or, Not gates, and by what is known is "functional completeness" they can compute all possible functions. eg this is the basic principle in an ALU. Challenge: create a circuit to determine whether an 8-binary-digit number is divisible by 3 and somehow vis...
Write a program that is capable of randomly generating itself. It must do this based on the tokens used in its source code. If your program's source code is composed of 50 unique tokens and is 60 tokens long, then the program should output 60 tokens where each token is randomly chosen from one of the 50 unique tokens. ...
It is wartime, and rationing is taking place in certain regions of your country. Your cities' region is one such region. The city chooses to give everyone the same amount, but in reality, larger people need more food. Chances are, a 200lb man is going to be eating more than that 7lb baby over there. The city, realizing...
Write a program that generates a winning sequence of moves to the deterministic variant of the game 2048. The sequence should be in the form of a string of numbers 0-3, with 0: up, 1: right, 2: down, 3: left. For example, the string "1132" means right right left down. The winning program is the shortest source code tha...
Aristotle's number puzzle is the challenge of populating each of 19 cells in a hexagonal grid with a unique integer between 1 and 19 such that the total along every axis is 38. You can picture the game board looking like this: And the puzzle, in essence, is the solution to the following set of fifteen equations: ((a +...
Write a program which takes a 3x3 matrix on stdin and prints its transpose along the anti-diagonal to stdout. You may assume that all elements of the matrix will be integers. Columns are space-separated and rows are newline-separated. Example Input: 1 2 3 3 4 5 1 2 3 Output: 3 5 3 2 4 2 1 3 1 Input: 1 2 3 4 5 6 7 8 9...
Your task is to format an address given in all lowercase to a friendlier format. Here's the catch, no regexes. Addresses will be given in the following format: 123 serpentine pl ne shoreline wa 98199 The expected output is the following: (notice the period and commas) 123 Serpentine Pl. NE, Shoreline WA, 98199 Formatt...
The Kolmogorov complexity of a string s is defined as the length of the shortest program P that outputs s. If the length of P is shorter than the length of s, then s is said to be compressible, otherwise s is incompressible. Most strings are incompressible ... Write the shortest program that outputs this string (withou...
Fillomino is a puzzle where you fill a grid with polyominoes. Each polyomino is an area of contiguous cells. The grid representation shows what size polyomino is covering each cell. For example, a pentomino(5) would be shown as 5 in each of five contiguous cells (see below). Two polyominoes of the same size cannot shar...
Task You will be given a set of circles in the plane with their centers on the line y=0. It is guaranteed that no pair of circles has more than one common point. Your task is to determine into how many regions into which the circles divide the plane. A region is an inclusion-maximal contiguous set of points not interse...
Pretty soon it's going to be 50 years since IBM unveiled its System/360 family of computers. These were the first to use the EBCDIC character set. To mark the occasion, let's see who can write the shortest program capable of converting "ordinary" text to and from EBCDIC code page 037. We'll be using a translation table...
The leaders of the world have met and have finally admitted that the best (and only) way of resolving global economic woes is to take stock of how much they owe each other and just pay each other off with huge cheques. They have hired you (ironically, at the lowest contract rate possible) to work out the best means of ...
You must write functions for addition, subtraction, multiplication, and division; however, you can never use any of your language's number types / primitives -- this means no ints, no floats, no Integers; no nothing. You cannot reference these types at all; not even implicitly, e.g. no pushing and popping numbers on a ...
A 2-way universal logic processor (2ULP) is a network of logic gates that takes two input wires A and B, as well as four other inputs L_, L_a, L_b, and L_ab, and produces a single output L(a, b) using the four L inputs as a truth table function: The 2ULP returns L_ if A and B are both 0. It returns L_a if A = 1 and B ...
Smallest code to return sum of all characters of an array of C-strings, including null-byte-terminattor of each string in the array. example in C: const char *a[] = { "abc", "bdef", "cee", "deee" }; size_t n = sumOfAllBytes(a); printf("n = %d\n", n); // n = 18 e.g., strlen(a[0]) + 1 + ... + strlen(a[n])...
Inspired by the ill-fated sorting-a-numbers-digits-without-using-an-array, but I thought it made a better code golf than SO question. Given a positive integer, sort the digits in that integer. Lowest score wins! Start with 0 points. Add one point per character. Add 20 points for each array you use. Add 10 points for e...
Scenario: while programming you have a sudden nostalgic urge for the '80s and cheesy games. Requirements: Make a GUI program (text probably won't work) for Simon, the game. Input can be clicking, or pressing a key. You should divide the screen into 4 regions: yellow, blue, red, green. When the game starts, a random col...
Jack and Jane decided to play a game of chess to while away time. Unfortunately, Jack is rather bad at visualizing. He finds it tough to figure the moves possible for a given piece other than a pawn, of course! Your challenge is to help find Jack the possible options for a given piece (other than a pawn). In case one...
...so this is a challenge to make me a tree. Produce a program or function called tree which takes a single integer argument, N and draws a Pythagorean Tree N levels deep, where level 0 is just the trunk. Each junction of the tree should place the vertex of the triangle at a random point on the perimeter (this point sh...
You have to write a program that will count all the characters in specified source file so that people entering a code golf competition can see their score. You do not need to ignore comments (it is code golf) in your program but newlines should be counted as a character. The number of characters must be printed to std...
Background: I often find that, when browsing a Stackexchange site, I begin to wonder how people get the amount of reputation that they have. I know I can always count on codegolf SE to solve my problems, so here it is: Create a program that will accept a positive integer which represents a person's reputation. We will ...
Challenge: Given two five-card hands, determine which one wins by the standard ranking of poker hands. Input: Ten cards separated by spaces from stdin or as command line arguments, whichever you prefer. The first five cards are Player 1's hand while the last five are Player 2's hand. Each card will be a two letter stri...
Doorknobs are great and all, but when you open a door, it always dents the walls around it. I need you to take input of ASCII art of a room, like this: +---------+--X --X --+-----+ | \ \ |\ | \ | | \ \ | \ | \| | X | \ | X | / | | \ X | ...
Intro You are sitting in a board room at the end of a long table. You look around and see Tim Cook, the Apple Board of Directors, the ghost of Steve Jobs, and Jack Donaghy. Apple has called this meeting because they have realized how much cooler the Android lock screen is, and they want to 1-UP them. Everyone in the ro...
Task: You are an amazing programmer and Stackoverflow-answerer, and you decide to answer every question with a bounty on Stackoverflow. You are so good, that you manage to get all the bounties in all the questions. While you wait for the rep to come flooding in, you write a program that goes and find out what the total...
Write a function/subroutine to sort a list of integers, Tower of Hanoi style. You will be given a stack of integers. This is the main stack. You are also given two more helper stacks. These helper stacks have a unique property though: every element must be smaller than or the same size as the element underneath it. Th...
Your task is to generate a valid juggling pattern by completing a given template. But first, you probably need to know how such a pattern is denoted. Introduction to Siteswap Siteswap is the established notation for juggling patterns. It works by dividing the pattern into beats. At each beat your left and right hand a...
Your task is to make a program that will take an input of a word of any length, in the Calibri font. This word will be made out of letter characters that are found on a normal QWERTY keyboard. There will be no accents or any other characters (i.e punctuation, numbers etc). So, the original characters are: A B C D E F ...
This is a pretty cool CodeGolf challenge in the sense that you're only going to have a limited amount of time to do it. You need to build a program that "mines" StackOverflow unicoins. In order to do this, you need to perform just two HTTP requests. I'm not going to say how, to add to the fun. The first person to do th...
This challenge has ended! Congratulations Flonk! I was sure I would get a good grade, but after turning in Flonk's my work, my professor did not believe it was mine and also could not understand why it was so complicated... I failed and my mom grounded me from Facebook and Minecraft for a month. I don't understand. :( ...
We have been cloning 2048, analyzing 2048, but why haven't we played it yet? Write a 555 byte javascript snippet to play 2048 automatically, the best score after an hour will count (see scoring below). Setup: Goto 2048 and run: a = new GameManager(4, KeyboardInputManager, HTMLActuator, LocalStorageManager); a is the ...
Beal's Conjecture has a million dollar prize if you prove/disprove it. It states that if where A, B, C, x, y, and z are positive integers with x, y, z > 2, then A, B, and C have a common prime factor. The challenge is to write a program that searches for a counter example to disprove this! Rules Write a program sear...
Edit: There will be a bonus of -20 for random masking Hello fellow Whistleblowers and carriers of secret knowledge. I am due to an interview by mail and I - of course - cannot say specific names in full length. But as I want to disclose it in a rather not-so-obvious-way I need your help. I will provide these names in t...
Can someone help me with simplifying this sequence. I write code to loop through entire n, I am getting timeout. Hack sequence of IndiaHacks-2014 if given as below Hi = 2014*Hi-1 + 69*Hi-2 for (i > 2); Hi = 1 for (i <= 2) Given n, you need to find nth term of Hack sequence modulo (109 + 7), i.e Hn % (109 + 7). This is...
Well the community is just a bot. But what if it would have been a person? Your task is to find what community's reputation might have been if it would have been given reputation for the edits it makes.(simply 2*edits) This should work for any site, but we would consider PP&CG for this question. Use any language, even ...
Write a code in your favorite language which reduces words To first three characters. Input : One word Output : First three letters For example INPUT : ProGramming OUTPUT : Pro INPUT : puZZles OUTPUT : puZ INPUT : BoWling OUTPUT : BoW Output needs to be case sensitive Rule-1 All statements should be meaning...
The Situation: Several (M) dwarves have found a goblin's chest with N gold coins and have to divide them. Due to ancient rules governing the allocation of loot to pirates in order of seniority, the oldest dwarf should get one coin more than the next oldest dwarf, and so on, so that the youngest dwarf gets M-1 fewer coi...
Problem Let's say that a word is almost a palindrome if it is possible to remove one of its letters so that the word becomes a palindrome. Your task is to write a program that for a given word determines which letter to remove to get a palindrome. The shortest code to do this in any programming language wins. Input Inp...
A man lives in the north-west corner (0, 0) of a town with height h and width w . Everyday he walks from his home to the border (?, w) or (h, ?). In the following example, the man goes to (3, 3) today. (0, 0) +--+ + + . (0, 4) | + +--+--+ . | + + + + . ...
Greetings, noble code golfers. Today you will resolve the most ancient and distinguished of debates - Emacs or Vim? Your challenge is to take two search terms as input, and output which of those terms has the most Google search results. (This is obviously completely fair. What do you mean, biased?) Here are some exampl...
This is a code-golf, so keep your code small! The objective is to create a function that receives 3 arguments: Rows(int): The max number of an item in each array; Cols(int): The max number of dimensions (sub-arrays); Val(*): The starting value in each item; This function should return a multidimensional array with...
Your challenge is to create a shortest code in your language of choice which writes on a .txt file the longest code to multiply two numbers by taking two numbers as input and output the answer. NO INPUT NEEDED TO YOUR CODE WHICH IS DOING THE WRITING JOB! The generator code and generated code can be in any languages Do ...
The Board The Board is a two dimensional array of cells. Cells are populated by Animals. Every day, all Animals on the Board simultaneously make one move. If two or more Animals move to the same cell, they fight until one remains. The possible moves and attacks are as follows: Moves - { Move.UP, Move.RIGHT, Move.DOWN,...
The Problem I have a bunch of regular expressions that I need to use in some code, but I'm using a programming language that doesn't support regex! Luckily, I know that the test string will have a maximum length and will be composed of printable ASCII only. The Challenge You must input a regex and a number n, and outpu...
I want to play Dungeons and Dragons, but I don't have any dice! Your challenge is to roll some D&D dice. The input format specification in Backus-Naur form is: <valid-input> ::= <opt-integer> "d" <integer> <opt-modifier> <opt-integer> ::= | <integer> <opt-modifier> ::= | "+" <integer> <integer> ::= "0" | "1" | "...
You are a secret agent trying to communicate with your fatherland. Of course the information needs to be hidden so no one eaves drops your message. What would be better suited than a cat? Everyone loves funny pictures of cats [citation needed], so they won't suspect secret information hiding in there! Inspired by the ...
Write a program which determines if a given number is prime. The catch: No digits or arithmetical operators. This means: No digits from 0 to 9, anywhere in the program, and whatever the meaning No using any built-in operators for addition (and incrementing), subtraction (and decrementing), multiplication, division, ex...
Merge Sort In this challenge, you will implement the merge subroutine of merge sort. Specifically, you must create a function or program or verb or similar which takes two lists, each sorted in increasing order, and combines them into one list sorted in increasing order. Requirements: - Your algorithm must take an asy...
I'm looking for the shortest code to generate the following sequences: Sequence A i | y x 0 | 0 0 1 | 0 1 2 | 1 0 3 | 1 1 The best I have is x = i % 2, y = i / 2, there is probably no beating that. Those are coordinates of corners of a box in 2D, but they are not in a good order for drawing. To draw a box as line loop...
A bit-counting comparator (BCC) is a logic circuit that takes some number of counting inputs A1, A2, A3, ..., An as well as inputs B1, B2, B4, B8, ... representing a number. It then returns 1 if the total number of A inputs that are on is greater than the number represented in binary by the B inputs (e.g. B1, B2, and B...
List the coordinates of 8 squares adjacent to (0, 0) in a 2d grid. Namely, [(1,-1),(1,0),(1,1),(0,1),(-1,1),(-1,0),(-1,-1),(0,-1)] Order does not matter. The goal is to store the points into a list. Shortest answer wins.
You are required to write a Hangman solver. Testing against this English word list[1], the solver that solves the most number of words wins, with the number of total incorrect guesses being the tie-breaker. All words in the word list will be tested in random order. [1]: This word list is taken from here, then the numbe...
Without using strings (except when necessary, such as with input or output) calculate the nth digit, from the left, of an integer (in base 10). Input will be given in this format: 726433 5 Output should be: 3 as that is the fifth digit of "726433". Input will not contain leading zeros, e.g. "00223". Test cases / furt...
As we learned from the IBM PC AT, YouTube (see video), Wikipedia (see article), and Sesame Street: The letter H is the most merciless letter of the alphabet! (Even when actually composed from two elements in Code Page 437. In fact, it's even MORE merciless that way.) Like the Aliens in, uhm...er... Aliens, Beasts rele...
Given a string of English alphabet characters, write the shortest code to print all possible permuations in lexicographical order without using any language based library. def function('bca'): return all_permutation. This should return : abc, acb, bac, bca, cab, cba
There is a table (the matrix one, not the one in your kitchen) called the "mex table". It has a left-top cell, at coordinates (0,0), but extends to infinity rightwards and downwards. The x-coordinate increases to the right and the y-coordinate increases downwards. Every cell has a value >=0, and the cell at (0,0) has t...
Count the number of unique fractions with numerators and denominators from 1 to 100, and print the counted number. Example: 2/3 = 4/6 = ... Rules: You must actually count in some way. Only integers are allowed, no floating point numbers or fraction types. Integers count as fractions. So 1/1, 2/1, etc is valid.
The other day we were writing sentences with my daughter with a fridge magnet letter. While we were able to make some(I love cat), we didn't have enough letters to make the others (I love you too) due to an insufficient amount of letters o (4) I then found out that while one set included 3 e letters it had only 2 o let...
From Wikipedia Set-theoretic definition of natural numbers The set N of natural numbers is defined as the smallest set containing 0 and closed under the successor function S defined by S(n) = n ∪ {n}. The first few numbers defined this way are 0 = {}, 1 = {0} = {{}}, 2 = {0,1} = {{},{{}}}, 3 = {0,1,2} = {{},{{}},{{}...
In as few bytes as possible, your job is to write a program that outputs: 3.14 In celebration of a late Pi day of course! :) Rules You can do it anyway you like, but there are some restrictions. You may not use arithmetic operations anywhere in your program. This includes +, -, *, /, %, ^ (exponentiation), etc... Thi...
Your challenge is to write a program which creates ASCII art from an input string, like FIGlet or the Unix banner utility. Specifically, your program should take as input a string consisting of printable ASCII characters, and output an ASCII art representation of those characters in the order they appear in the input. ...
My obsession with set theory continues. I believe that most programming languages have neither sets as possible structures nor set theory operations such as Union and Intersection. If I am wrong then this question becomes trivial and I learn something new. It would be fun to ask for the code golf construction of a ful...