instruction stringlengths 34 53.1k |
|---|
Challenge
You just bought a brand new chair! Problem is, you have no idea how to control it so you'll need to write a program to do it for you.
You can only sit in the unadjusted chair for so long. So your code will need to be as short as possible.
Examples
5,3,2,2,1
O
|
|
| _
| |
|_|_
|
|
O
3,5,2,3,5
O
| _... |
What general tips do you have for golfing in Prolog? I am looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Prolog (e.g. one letter variables is not specific to Prolog to reduce the size of programs).
Please indicate in your tips if it is specific to an imple... |
Yes, how much, not how many...
As we all know, a large present is far better than a small one. Therefore, the value of the presents should always be measured in total volume, not number of presents, weight, or even combined price.
As it's frowned upon to compare the amount of presents one gets, you don't want a long s... |
Background
Due to some unfortunate accident during coding you are now teleported and stranded on an alien planet. You really hope that the locals will be helpful and point to the general direction of how to get home, but before trying to talk to them you want to decipher their language. Fortunately it looks like the al... |
A Caesar shift is probably something we're all familiar with.
(You might be even doing it as a homework task. If so, please don't copy these answers, your teacher almost certainly doesn't want anything like the answers here.)
Just in case you aren't, a Caesar shift is a very simple form of cipher. It takes a string to... |
"Counter" is a language I've created for the purpose of this question.
Rules
Commands are read from left to right from the first character.
Each command may be executed as it is read, or you may execute all commands together at the end.
In case of an error, all commands up till the error must be executed.
A program is... |
Draw a program or function that will write to STDOUT n times (each for one step) a string that contains a dot . at the location of the walker. The program also needs to write a line every s seconds (or wait s seconds after each line).
A random walk is a mathematical formalization of a path that consists of a succession... |
You will be given two pieces of input: a string in run-length encoded format defining the running track, and a capital letter representing the lane to start from. For example, the string "3a4A6b5B" expands to "aaaAAAAbbbbbbBBBBB". You then use the expanded string to create a track, as such:
A) aaaAAAA
B) bbbbbbBBBBB
... |
2013 has the prime factorization 3*11*61. 2014 has the prime factorization 2*19*53. An interesting property regarding these factorizations is that there exist distinct primes in the factorizations of 2013 and 2014 that sum to the same number: 11+61=19+53=72.
Write a program or function that takes as its input two posit... |
Write an interpreter for 2B
I like David Catt's esoteric language 2B, having memory stored in a tape where each cell is a seperate tape of bytes (the 'subtape'). Write an interpreter for it!
Language Specification
Official specification can be found here. In this specification, " means a number in the range 0-9 (0 is i... |
In his xkcd about the ISO 8601 standard date format Randall snuck in a rather curious alternative notation:
The large numbers are all the digits that appear in the current date in their usual order, and the small numbers are 1-based indices of the occurrences of that digit. So the above example represents 2013-02-27.
... |
In his xkcd about the ISO 8601 standard date format Randall snuck in a rather curious alternative notation:
The large numbers are all the digits that appear in the current date in their usual order, and the small numbers are 1-based indices of the occurrences of that digit. So the above example represents 2013-02-27.
... |
In this challenge, you will receive an input, convert it to hexadecimal, make a couple changes, and output the result.
Because they are only 16 characters in hexadecimal, your code will need to be as short as possible.
Examples
Examples are separated by a blank line. First line is input, second line shows the steps, t... |
Task
Given input N, generate and output an NxN grid where each row, column and the two diagonals contain the numbers 1 to N (or 0 to N−1 if that's easier).
Input
The input is a positive integer N. It represents the number of columns and rows in the grid. For this problem, you can assume N will be a reasonable size, 4 ≤... |
Introduction
Santa has too many names to process, and needs your help! He needs you to write a program or a function, which outputs nice, naughty, very naughty or very very naughty. To determine how nice or naughty someone is, Santa had developed an algorithm:
Nice (division, math):
First of all, we obtain a number fro... |
The Cheela (from the book Dragon's Egg by Robert L. Forward) are creatures that live on the surface of a neutron star. Their body is flat and circular with twelve eyes on the perimeter, so they naturally use a base-12 numbering system.
Among the Cheela, care of the hatchlings and education of the young are tasks carrie... |
Here in California, we're in a drought so we need to know how much water we have left so we can conserve as much water as possible.
Because water is limited supply, your code will need to be as short as possible.
Examples
| |
| |
|~~~|
|___|
Output: 0.5
|~~~~~|
| |
| |
|_____|
Output: 1
| |
|__|
Outpu... |
https://en.wikipedia.org/wiki/Losing_chess
This is basically Chess Tournament, but for antichess ;)
Antichess is one of the many chess variants that have been invented. The goal is to lose all your pieces (this may seem a little odd, but it's called antichess for a reason).
The rules
The rules of antichess are very si... |
A double precision representation of a decimal can only guarantee an accuracy of 15 decimal places, thus pi is approximated as:
3.141592653589793
You can see that the digit 3 is in positions 1, 10, 16, the digit 1 is in positions 2, 4 etc.
Challenge
Your task is to create a program or function that creates a random d... |
Everyone knows that cats go meow, but what many don't realise is that caaaats go meeeeoooow. In fact, the length of the vowel sounds that the cat makes are dependant on the length of the vowel with which you address it.
In the same way, cows go moo, but coooows go moooooooo
Challenge
You are to write a program that tak... |
Description
Write a function f(m, G) that accepts as its arguments a mapping m, and a set/list of distinct, non-negative integers G.
m should map pairs of integers in G to new integers in G. (G, m) is guaranteed to form a finite abelian group, but any element of G may be the identity.
There is an important theorem that... |
Obviously, code golfing is all about making the most of the least code. Who really cares what the actual output is?
While we have had a challenge for highest input-to-output ratio, this is a call for most finite and deterministic output with given code lengths. Ironically, this challenge is then not code-golf.
Rules:
... |
For once, I was doing some real work, updating old code, and bumped into an expression that is equivalent to what would be written as πx + ex in good old-fashioned math. I thought it would be possible to write it shorter than it was written in the language I work with (APL), and therefore present this very simple chall... |
Inspired by this wonderful (based on the number of views and votes) challenge, which, in my humble opinion, has way too few answers.
Given (by any means) a list of strings, return (by any means) a set of letters that, when removed from the given strings, leaves the total length of (what remains of) the strings as small... |
A simple code golf challenge similar to an already existing, but more complex one:
Wait for user to press enter.
Wait for user to press enter again.
Print the elapsed time between the 1. and 2.
Wait an equal amount of time
Print the actual elapsed time of 4.
Order of 3. and 4. is not important. Notice that the second... |
The task here is to read from a Golly .rle or plaintext file (your choice) whose filename is provided (on STDIN or as a command line argument) and identify and count the common patterns in the grid encoded therein.
Alternatively, you may choose to have the contents of the file provided directly over STDIN instead.
Your... |
Objective Write a full program that outputs (to STDOUT or closest alternative) an arbitrary string of text, no more than 64 characters long. Simple enough, right? Well, here's the catch: You may not use any characters that were present in the previous answer's output. That's right, none of them.
Thus, you are trying to... |
An linear discrete convolution is an operation that turns two vectors of numbers into a third vector of numbers by multiplying elements inside-out. Formally, for two vectors a and b with elements 0 to n - 1, the discrete linear convolution of a and b can be computed with this loop:
for i = 0 to 2*n - 2
c[i] = 0;
... |
Introduction
A pentagonal number (A000326) is generated by the formula Pn= 0.5×(3n2-n). Or you can just count the amount of dots used:
You can use the formula, or the gif above to find the first few pentagonal numbers:
1, 5, 12, 22, 35, 51, 70, 92, 117, 145, 176, 210, 247, 287, 330, 376, 425, 477, etc...
Next, we nee... |
Challenge
In this challenge, you will be writing the first program, p1, of an infinite sequence of programs, in which running pn outputs/generates program pn+1. When concatenating the first n >= 2 programs, the sequence should output n.
Example
Let's say the first 4 programs are:
p1 p2 p3 p4
If I were to run p1, it sh... |
I didn't check the sandbox before posting this challenge - it looks like this challenge was proposed by Cᴏɴᴏʀ O'Bʀɪᴇɴ.
Given an integer input, write a program that prints the "four is a magic number" riddle
Four is the magic number
Five is four and four is the magic number
Six is three and three is five and five is fo... |
Colonies of bacteria labelled 1 through 9 live on a segment of equally-spaced cells, with empty cells indicated by 0
0 0 2 0 0 0 1 2 0 0 3 3 0 0
Every second, each colony spreads to adjacent empty cells. If two colonies reach an empty cell at the same time, the larger-labeled colony takes it.
t=0: 0 0 2 0 0 0 1 2 0 0... |
The challenge is simple:
Write a function or program that takes an input x, and outputs the lower case alphabet if x is part of the lower case alphabet, outputs the upper case alphabet if x is part of the upper case alphabet and outputs just x if it's not part of either.
Rules:
The input can be function argument or fr... |
This challenge consists of two parts. The winner will be the solution with the lowest total byte count. The same language must be used for both challenges.
Part 1:
Write a function or program that takes a sentence with only valid words as input, and outputs a list of the used characters, the number of times each letter... |
In an effort to level the playing field between languages with built-in date libraries and those without, let's work with a fictional calendar. The Forgotten Realms are a (the?) campaign setting for Dungeons & Dragons. Of course, each have their own calendar.
The Calendar of Harptos
Conveniently, a year in the Forgott... |
You must do a program that reads a file given in first argument and print it's content to STDOUT and number the lines on the file, the numbers should be followed by a space.
For instance, assuming that your program is named cat, we could write
./cat "myfile.txt" (or execute it with its interpreter)
With myfile.txt:
Hel... |
The idea of this challenge is to find all the words from a dictionary on a grid of letters. Your input should come from stdin or function arg and will come in the following format:
[your dictionary as a list of space sep words]
[a grid of letters]
Example:
The cool car
looc
thea
jopr
Rules for finding a match
A matc... |
Given a deck consisting of N copies of cards with integer values [1,M] for a total of N*M cards, compute the probability that a card with the value of 1 is adjacent to a card with the value of 2.
Your solution may be exact or approximated, and it does not need to be the same for every run given the same inputs. The giv... |
Introduction
Imagine that line of chars is in fact two rows. Upper row - dots - represents hours (24 hour system), while lower - commas - represents minutes. One character can represent hour, minute or both - whenever it's possible.
At first probably you'd have to convert minutes since midnight to hours and minutes.
... |
Trump needs the wall constructed and you are going to do it! To most efficiently build his wall I have created a simple, repeatable pattern for you to use:
__ __
| |_| |
___| |___
- - - -
- - - - - - -
- - - - - - - -
———————————————
Trump will tell you how many wall segments he needs... |
When making a Dungeons & Dragons character, an alternative to rolling ability scores is to assign them within a power budget called point buy. Higher ability scores cost more points, especially towards the upper end: a score of 8 is free, and raising a score by 1 costs 1 point, except raising to 15 or 16 costs 2 points... |
While there are many edit distance questions, such as this one, there isn't a simple question to write a program that calculates the Levenshtein distance.
Some Exposition
The Levenshtein edit distance between two strings is the minimum possible number of insertions, deletions, or substitutions to convert one word into ... |
The Binary Sierpinski Triangle sequence is the sequence of numbers whose binary representations give the rows of the Binary Sierpinski Triangle, which is given by starting with a 1 in an infinite row of zeroes, then repeatedly replacing every pair of bits with the xor of those bits, like so:
f(0)= 1 ... |
This challenge is based on Downgoat's Adjust your chair.
Challenge
You just adjusted your new chair! It fits you perfectly. However, the wheel is squeaky and you know the repair people will change the adjustment. Problem is, you don't have a ruler, so you'll have to write a program to measure it for you.
The repair pe... |
Introduction
Of course, we've got a lot of sequence challenges, so here is another one.
The Kimberling sequence (A007063) goes as following:
1, 3, 5, 4, 10, 7, 15, 8, 20, 9, 18, 24, 31, 14, 28, 22, ...
This is produced by shuffling the normal iteration:
[1] 2 3 4 5 6 7 8
The first term of the sequence is 1. Aft... |
Overview
Run-length encoding — sequences in which the same data value occurs in many consecutive data elements are stored as a single data value and count
When using run-length encoding:
Input: ABBBCCACB
Output: 1A3B2C1A1C1B
This sample has an output that is larger than the input.
Instead, it can be simplified for... |
Introduction
As ToonAlfrink says: "Me thinks there aren't enough easy questions on here that beginners can attempt!". So the task is very simple. Given a string, output a truthy or falsy value whether the name is official or not.
A name is "official" if it is a single title-case word, that is:
If the first letter is c... |
If you've ever played Spacewar!, you know it was a fun game. If you haven't, know this: it was (and is) one of the very first and most important computer games. And it's still fun! The clone I grew up on is this one, which is, apparently and unfortunately, Windows only. So I recreated it!
The KotH is hosted here: PPCG... |
In this challenge, you are passed two things:
A string length, N
A list of strings, L, each with an assigned point value. Any string that is not passed in has a point value of 0
You need to construct a string of length N such that the sum of all substring points is as large as possible.
For example:
5 [("ABC", 3), (... |
Many important topics in abstract algebra involve a binary function acting on a set. A number of properties of such functions have been defined in the investigation of such topics.
Your challenge will be to determine whether a given binary function on a given domain possesses five of these properties.
Properties
Closur... |
Given a string input, your task is to write a program that prints a truthy value to STDOUT or equivalent if the input contains "2016" anywhere in it without using any built-in contains, match, replace, split or other functions that use patterns or regexes.
A truthy value also must be printed if the input contains "2016... |
Paper stars are a big thing in my family at christmas, so I thought a virtual one would be cool.
Below is an image of a regular dodecahedron (from https://en.wikipedia.org/wiki/Dodecahedron, attributed to the author mentioned there.)
The process of stellation (wikipedia) when applied to a polyhedron involves extending... |
Santa needs some help determining how many elves he will need to help him deliver gifts to each house.
Coal is considerably heavier than presents, so santa will need three elves for every naughty person in the house. Only two elves are needed to help santa carry presents.
On santa's map, a house is represented by a *, ... |
Quipus are an ancient device used by the Inca in the Precolumbian era to record numbers in a base ten positional system of knots on a cord, which works as follows:
Each cluster of knots is a digit, and there are three main types of knots: simple overhand knots; "long knots", consisting of an overhand knot with one or ... |
It's almost Christmas, so Santa has to plan his route. You're helping him, for reasons unknown.
Santa needs help planning the route and wants you to give him a solution, but since you're all ungrateful and unwilling to give to the man who has given you so much, so have decided to give him a program with as few bytes as... |
Introduction:
Before the task, here is what every element does on the map:
Plain land (X): This does nothing.
Destroyed land (-): This is the same as plain land, but destroyed by a bomb.
The active bomb (!): On a map, this will destroy everything in a 3x3 square:
XXXXX XXXXX
XXXXX ... |
Recently I've been writing a new language, to avoid needing to handle order of operations, I simply parenthesize each expression properly to avoid this entirely.
Because parenthesis are at char-codes 40-41, your code will need to be as short as possible.
Examples
1+2*3
(1+(2*3))
2*(3+4)
(2*(3+4))
2*3/4+3
(((2*3)/4)... |
The goal of this challenge is to compute one kind of numerology digit from strings containing characters and numbers.
The input may be through any convenient method (standard input, arguments, separated file).
The input may contain any printable ASCII chars, but only alphanumerical (A-Z, a-z, and 0-9) have to be consi... |
Background
Inspired by this Unix.SE question (and of course my own answer).
When an IP address is specified for an interface, it is often given in this dotted-decimal form:
a.b.c.d e.f.g.h
where a.b.c.d is the actual address and e.f.g.h is the netmask.
The netmask, when represented in binary, is basically a bunch of 1... |
Donald Trump is very impressed with the work of the people on this site. He saw how amazing of a job you did helping Ben Carson, so he even hired you to build his wall. He thinks you're terrific. Now he needs your help again. While he has successfully built his wall, now he needs the Mexican government to pay for it. H... |
The aim is simple: given the string of resistance values, draw the part of "electrical circuit" of those resistors. Examples follow.
Input: 3. Output:
--3--
Input: 1,2,3. Output:
--1----2----3--
Next, the resistors can be joined parallel (by 2 or 3 resistors per join), but the required depth of parallel joins is on... |
First of all ... I would like to wish everyone a Merry Christmas (sorry if I am a day late for your timezone).
To celebrate the occasion, we are going to draw a snowflake. Because the year is 2015 and Christmas is on the 25th (for a large portion of persons), we will draw a Pentaflake. The Pentaflake is a simple fracta... |
In this challenge you and your friends are debating on which case is better, uppercase or lowercase? To find out, you write a program to do this for you.
Because esolangs scare your friends, and verbose code scares you, your code will need to be as short as possible.
Examples
PrOgRaMiNgPuZzLeS & CoDe GoLf
0.52 upperca... |
The goal of this challenge is to create a program that outputs a string depending on the time of year.
Output
If the date is December 25, output:
Merry Christmas!
If the date is December 31 or January 1, output:
Have a Happy New Year!
If the date is between December 25 and December 31 (exclusive), output:
Happy Hold... |
Objective
Write the shortest program possible that adds semicolons to the end of all lines of code in a file unless:
it already has a semicolon at the end
the line is blank.
Must be a complete program.
Bonuses
Write the program so it won't produce any compiler errors when running the program on a C Header File.
|
Your challenge is to determine whether the given input is an integer, a string, or a decimal.
Rules
A string is any input that is not an integer or a float
An integer must contain only numeric characters and must not start with a zero
A decimal is any input that contains the period (.) and the period is surrounded by ... |
A fountain is arrangement of coins in rows so that each coin touches two coins in the row below it, or is in the bottom row, and the bottom row is connected. Here's a 21 coin fountain:
Your challenge is to count how many different fountains can be made with a given number of coins.
You will be given as input a positi... |
This is the cops' thread. The robbers' thread goes here.
Write a program or function consisting only of printable ASCII characters (that excludes tab and newline) that outputs at least 5 printable ASCII characters in ascending order (from space to tilde / 32 to 126). Characters can be outputted several times, as long a... |
This is the robbers' thread. The cops' thread goes here.
In the cops thread, the task was to create a program that outputs printable ASCII characters in ascending order. The robbers task is to unscramble the code the cops used to produce this output.
The cracked code doesn't have to be identical, as long as it has the ... |
Introduction
Number theory is full of wonders, in the form of unexpected connections. Here's one of them.
Two integers are co-prime if they have no factors in common other than 1. Given a number \$N\$, consider all integers from 1 to \$N\$. Draw two such integers at random (all integers have the same probability of bei... |
Normally, challenges are scored in bytes, or sometimes Levenshtein distance, but for this one we're using keyboard distance -- the number of keys between the keys used to type the program (use the above keyboard as the definitive reference). For example, the distance between A and F is 3, because the path is A=>S=>D=>... |
Introduction
I Ching is an ancient divination text and the oldest of the Chinese classics. It uses a type of divination called cleromancy, which produces apparently random numbers.
The basic unit of the Zhou yi is the hexagram (卦 guà), a figure composed of six stacked horizontal lines (爻 yáo). Each line is either broke... |
Introduction
XOR is a digital logic gate that implements an exclusive or. Most of the times, this is shown as ^. The four possible outcomes in binary:
0 ^ 0 = 0
0 ^ 1 = 1
1 ^ 0 = 1
1 ^ 1 = 0
This can also be seen as addition modulo 2 in binary. In decimal, we need to convert the decimal to binary, 35 = 100011 and 25 =... |
Some background
In math, a group is a tuple \$(G, *)\$ where \$G\$ is a set and \$*\$ is an operation on \$G\$ such that for any two elements \$x, y \in G, x * y \in G\$.
For some \$x,y,z\in G\$, basic group axioms are as follows:
\$G\$ is closed under \$*\$, i.e. \$x * y \in G\$
The operation \$*\$ is associative, i.... |
Inspired by this xkcd
You work for Shazam and they have a project for you. Some customers are complaining about their app taking up too much space on their phone, so they want you to code a lite version of the app. Unfortunately, your existing code can only understand the word "na", and you have to ship soon. That's o... |
You're designing a new esoteric programming language and
one feature you've decided to add is a dynamic memory allocator. Your language specifies a special dedicated virtual address space for the user's program space. This is separate from the address space used by the memory allocator for any internal state.
To help r... |
The challenge is simple: given two parameters, x and y, output y staircases with x steps. For example:
f(3,1) - 1 staircase with 3 steps.
_
_|
_|
f(5,2) - 2 staircases with 5 steps.
_ _
_| _|
_| _|
_| _|
_| _|
Make sure you output the staircases just like,... |
Recently I've been having some trouble with the new TeaScript interpreter. The biggest problem is identifying whether or not a string contains any special characters.
Challenge
A special character is defined as a character with codepoint 160 to 255. You will be given an input which is a string of characters with codep... |
Input: A single word as a string (matches [a-zA-Z]+). If the input doesn't follow these guidelines, print "Error" (but no error should be thrown)
Output: The NATO pronunciation of the word. Print out a space separated list of the NATO word that matches each letter of the input word. Trailing white space is accepta... |
I think the question as above is clear, but just in case:
Write a full program (not just a function) which prints a positive base 10 integer, optionally followed by a single newline.
Qualifying programs will be those whose output is longer (in bytes) than the source code of the program, measured in bytes (assuming AS... |
Explanation:
Last year in math class, on homework we would occasionally get these extremely simple, although equally annoying questions called diamond puzzles. These were basically questions where we would be given a sum, and a product then were asked to find the two numbers which when multiplied give the product, and ... |
Time for another Pyth practice. I present here 8 problem statements with a Pyth solution each. These solutions are written by a Pyth beginner. He is quite happy about these solutions, since they are a lot shorter than his Python answers. Your task however is to show him better. Create equivalent but shorter programs.
T... |
Introduction
The Parsons code is just a simple way to describe pitch variations in a piece of music, whether a note is higher or lower than the previous one.
Even if you suck at remembering tunes, you can still pretty much remember if a note goes up or down, thus the Parsons code can help you to identify a music using ... |
Recently, I made a made a typo and I wrote unicorn instead of unicode, I did what any normal person would do and I made an esolang out of it. In this challenge you will be writing a Unicorn interpreter.
Because Unicorn programs are horrible long, you'll have to write a short interpreter to compensate for this.
Example
... |
In my room, I have this geeky clock (click for full size):
Most of these are not difficult to figure out, but the one for 4-o-clock is particularly tricky:
Normally, a fraction like 1/2 doesn't make sense in modular arithmetic since only integers are involved. The correct way, then, is to see this as the inverse of 2... |
In physics, like electric charges repel, and unlike charges attract.
The potential energy between two unit charges separated by a distance d is 1/d for like charges and -1/d for unlike charges. The potential energy of a system of charges is the sum of the potential energies between all pairs of charges.
Challenge
Deter... |
Conceptually, this challenge is really simple. You're given a list of non-negative integers ai. If possible, find a non-negative integer N, such that the list consisting of bi = ai XOR N is sorted. If no such N exists, output should be anything that can't be mistaken for a valid N, e.g. a negative number, nothing at al... |
We've had a lot of challenges on differentiation and integration, but none on just solving related rates problems. So in this challenge, you will get a bunch of derivatives (They will be numeric, not in terms of any variables) and have to find another derivative.
The input will come in a newline separated list of equat... |
In long multiplication, after multiplying the numbers, you are left with the partial products, in this challenge you will output those partial products.
Because long multiplication is long, to compensate your code will need to be as short as possible.
Examples
34, 53
102, 1700
48, 38
384, 1440
361, 674
1444, 25270, ... |
Given a word consisting of lowercase letters only, do the following:
For each letter, get the prime factorization of its position in the alphabet.
For each prime factor, p, draw a diamond of side length p and stick the letter in the middle of the diamond.
The biggest diamond is in the middle, subsequent smaller diamon... |
Given an input string, determine the number of regions that a page will be split into.
Consider the letter P. It has one enclosed region within the letter. Assume that each letter splits the page by one or more regions (i.e. a box is drawn around the character).
Input
A string of 0 or more characters. You may assume th... |
Input
A matrix M represented as two space separated lines of integers. Each line will have the same number of integers and each integer will be either -1 or 1. The number of integers per line will be at most 20. M will therefore be 2 by n where n is the number of integers on each of the two lines.
Your code should be... |
Introduction
The Enigma was one of the first electro-mechanical rotor cipher machines used in World War II. That means that after a single letter is coded, it would change the key for the next letter. This was considered unbreakable by the Germans, due to the enormous key space. Even brute-forcing was almost impossible... |
If you have ever travelled with kids more than about 20 minutes, you will have no doubt heard cries of "Are we there yet?" and "How much further?"
So we play games like "I Spy" to help pass the time as the miles go by.
There is a variation on "I Spy" whereby instead of spotting arbitrary named things, you must spot int... |
Yes, this is old and probably very simple, but I really want to be mindblown by things that I thought were obvious, so here's the challenge:
You're given a positive integer as the input and you need to output the exponents of all of the prime factors up to the highest factor in base 36 ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a... |
In the game Terraria, one of the game mechanics involves building houses so that an NPC can move in. There is a strict set of rules for what counts as a valid house or not. Here is the list of rules:
The total area in the house must be at least 60 square tiles, but less than 750. Also, the size of the house including ... |
Challenge
Here's a simple one.
Write a function or program when given a number in base 10 as input, it will return or print that number's value in Hexadecimal.
Examples
15 -> F
1000 -> 3E8
256 -> 100
Rules
No built-in Hexadecimal functions whatsoever
Letters may be lowercase or uppercase
You will only need to worry a... |
The challenge is to follow (draw) the path:
^n - up by n lines
vn - down by n lines
>n - right by n character positions
<n - left by n characters positions
n is an integer, greater than zero (i.e. you can't receive a command like >-2).
There're no separators between the commands, the well-formed input looks like th... |
It's well known that corrupted JPEG files or NTSC/PAL streams will appear as distorted versions of the true images, or versions covered in random-looking blocks of pixels.
Consider the below image (from here):
If we run it through this filter (with settings 44, 7, 21, 83, for anyone who wants to reproduce it), it end... |
Task
Constantly having to check on television, or the time on your computer to see if its 2016 is a tedious task. Being programmers, we should be able to automate this task. Write a program that will output 2016 when the system time hits Friday, January 01, 2016 00:00:00. or rather 1451624400000 ms since midnight Janua... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.