instruction stringlengths 34 53.1k |
|---|
This is not a challenge. I'm wondering if it's at all possible to get user input into two separate variables in python (2 or 3) with less than 19 bytes. These are all the shortest I can get:
a,b=input(),input()
a=input();b=input() (newline replaced with semicolon for readability)
i=input;a,b=i(),i()
Is there any short... |
There's the classic run length encoding and decoding.
input output
a3b2c5 aaabbccccc
And that's fairly straight forward and done before.
The challenge is to also account for a non-standard behavior when multiple characters precede the run length (a single digit from 0-9). Each character before the run length digit ... |
Your mission, should you choose to accept it, is to add the minimum number of parentheses, braces, and brackets to make a given string (containing only parentheses, braces, and brackets) have correct brace matching. Ties of symbols added must be broken by having the maximum distance between paired braces. You must retu... |
One of the most common voting systems for single-winner elections is the plurality voting method. Simply put, the candidate with the most votes wins. Plurality voting, however, is mathematically unsound and is liable to create situations in which voters are driven to vote for the "lesser of two evils" as opposed to t... |
This is an endgame board of Settlers of Catan:
Background:
The roads (the long stick pieces) and the settlements (and cities) are rendered by the little huts. We encode the placement of these pieces by using the following scheme: From the top, we have a row horizontal vertices and edges where a road can be placed. The... |
Your job is to take the prime factors of a number taken from input (omitting any exponents equal to 1) then take the prime factors of all of the exponents, and so on, until no composite numbers remain; and then output the result.
To make what I'm asking slightly clearer, here's a javascript program that does it, but, a... |
There are 95 printable ASCII characters:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
In the Consolas font (the Stack Exchange code block default), some of the characters have mirrors around a vertical axis of symmetry:
These pairs of characters are mirrors of each o... |
Define the function f(n) for a positive integer n as follows:
n / 2, if n is even
3 * n + 1, if n is odd
If you repeatedly apply this function to any n greater than 0, the result always seems to converge to 1 (though nobody's been able to prove that yet). This property is known as the Collatz Conjecture.
Define an in... |
Your task in this challenge is to analyize a given "Matchstick Equation" like this one...
... and to find out whether it can be turned into a valid equation by rearranging the matches. If so, you are to output the least number of moves to do so and the resulting equation.
Input
The input is a String that can be read f... |
You are the owner of a restaurant. You are opening in a new area in Cartesia where there is only one main road, known as the y-axis. You want to place your restaurant such that you minimize the total distance from your restaurant and each of the houses in that area.
Input:
The input will be
n, the number of houses
hous... |
This Stack Snippet draws an aliased white rectangle on a black background given parameters for its dimensions, position, angle, and the grid dimensions:
<style>html *{font-family:Consolas,monospace}input{width:24pt;text-align:right;padding:1px}canvas{border:1px solid gray}</style><p>grid w:<input id='gw' type='text' ... |
Write a program that outputs a list of the number of occurrences of each unique character in its source code.
For example, this hypothetical program {Source_Print_1}; should produce this output:
; 1
P 1
S 1
_ 2
c 1
e 1
i 1
n 1
o 1
p 1
r 2
t 1
u 1
{ 1
} 1
The formatting should match this example. No extraneous whitespa... |
Objective:
Code two programs where each of the programs outputs both source codes
interlaced per character like a zipper, a Double-slit Quine. The output from a Double-slit Quine
is starting with the first character from the source code of the first
program. If the source code of one of the programs is shorter i... |
Okay, I recently wrote a Javascript Rubik's Cube scrambler that outputs a 25-move scramble. It's 135 bytes. The Gist is here, but for reference, I have the formatted code:
function(){
for(a=s=y=r=[],m='RLUDFB',x=Math.random;++a<26;y=r,s.push(r+["'",2,''][0|x()*2]))
for(;r==y;r=m[0|x()*5]);
return s.join(' ')
}
A... |
The game of Chinese checkers is played on a board with spaces in the shape of a six-pointed star:
Image from Wikipedia
We can create an ASCII-art representation of this board, using . for empty spots and the letters GYORPB for the six colored starting locations:
G
G G
G G G
G ... |
Introduction
For many centuries, there has been a certain river that has never been mapped. The Guild of Cartographers want to produce a map of the river, however, they have never managed to succeed -- for some reason, all the cartographers they have sent to map the river have been eaten by wild animals in the area. A ... |
As part of his answer to Make an Error Quine!, @Falko proposed the following algorithm:
How to create your own solution in 2 minutes?
Open a new file in an IDE of your choice.
Bang your head onto the keyboard in front of you.
Compile.
Replace the code with the compiler error message.
Repeat steps 3 and 4 until the co... |
Write two programs such that when the bytes of their source code are XOR-d together it produces a third, valid program, all in the same language. The length of each of the three programs in bytes must be identical.
The first program should output A. The second program should output B. The third program should output C.... |
In this challenge, you are required to shift characters in an inputted string n number of times and output the shifted string
Input
Input will first contain a string. In the next line, an integer, which denotes n will be present.
Output
If n is positive, shift the characters in the string to the right n times.
If n is... |
UPDATE:
The gist-files are updated (including new submissions) as the Controller.java did not catch Exceptions (only errors). It does now catch errors and exceptions and also prints them.
This challenge consists of two threads, this is the cat thread, the catcher thread can be found here.
The controller can be download... |
UPDATE:
The gist-files are updated (including new submissions) as the Controller.java did not catch Exceptions (only errors). It does now catch errors and exceptions and also prints them.
This challenge consists of two threads, this is the catcher thread, the cat thread can be found here.
The controller can be download... |
Task
Write a program that reads three integers m, n either from STDIN or as command-line arguments, prints all possible tilings of a rectangle of dimensions m × n by 2 × 1 and 1 × 2 dominos and finally the number of valid tilings.
Dominos of an individual tiling have to be represented by two dashes (-) for 2 × 1 and tw... |
This contest is over.
Due to the nature of cops-and-robbers challenges, the cops challenge becomes a lot easier when the interest in the associated robbers challenge has diminished. Therefore, while you can still post hash functions, your answer will not get accepted or form part of the leaderboard.
This challenge is... |
This contest is over.
There are no remaining crackable answer in the cops challenge.
Companion thread of Cryptographic hash golf
As a reminder, here are the rules for robbers from the main challenge:
Task
Crack any of the cops' submissions by posting the following in the
robbers' thread: two messages M and N in I ... |
A Young diagram is an arrangement of boxes in left-justified rows and top-justified columns. For each box, all the spaces above it and to its left are occupied.
XXXXX
XXX
XXX
X
The hook length of a box is the number of boxes to its right in its row, and below it in its column, also counting itself once. For example, t... |
We've been twice challenged to make 'error quines' (see Make an error quine! and Make a slow error quine maker!), so why don't we try the opposite?
Instructions
Write a "program" that, when run, produces an error.
Copy the error message into a new program, and run it.
Repeat Step 2 until the program runs without produ... |
I have noticed that there are a disproportionate number of computer languages based on English. I propose to fix this by translating existing computer languages into foreign languages!
Pick a computer language that uses English keywords/functions
Pick any natural* language other than English
Write a program that trans... |
Your job is to replace the battery packs on many floating fish tracking
devices in the shortest time. You must leave your base in the base helicopter
and visit each tracker once, then return to the base.
Finding the optimum route is known to be hard, but there is an additional
difficulty! Each tracker has a drift veloc... |
We all love horoscopes, don't we? But I have a serious problem in this Horoscope App installed on my Smart Phone that it only displays the icon of the Zodiac Sign for each day's horoscope. Now, I do remember my horoscope, but its hard to remember others' whose horoscope I am interested in.
Challenge
So here is your cha... |
Introduction
The number 101 is a palindrome, since it reads the same backwards and forwards. The number 105 is not. However, 105 in base eight is written as 151, which is palindromic. On the other hand, 103 is not a palindrome in any base from 2 to 101. Hence, 103 is strictly non-palindromic.
The precise definition is:... |
Another XKCD inspired competition.
This one is based on Keyboard Mash.
Given a input string, identify the anomalous characters, assuming that the majority have been typed on a single row of the standard US QWERTY keyboard.
Input strings can contain shifted key strokes, but they will not contain carriage returns (Enter)... |
I made a joke the other day and sent it to some friends. One replied back "I love the irony!" and I looked at it and realized there was some irony in it. But that wasn't the irony she saw - the irony she was was the punchline of the joke, which wasn't ironic in the slightest.
And it got me thinking about a certain othe... |
Please excuse the punny title.
This is a question is inspired by A Curious Property of 82000. In it, the author points out that the number 82000 is binary in base 2, 3, 4, and 5. The post then poses the question "is there a number that is binary in bases 2, 3, 4, 5, and 6"? (For those curious, I've checked values ... |
My teacher always gives me the most complicated set of math problems for homework. Like: pg. 546: 17-19, 22, 26, pg. 548: 35-67 odd, 79, 80-86 even. And I want to know in advance how much time to set aside for my homework, but I don't want to have to figure all that out. That's why its your task to program it for me.
S... |
Here are five images of pears and a steel chute:
A: B: C: D: E:
These are only thumbnails, click them for full size!
(I made these with Algodoo.)
This class of images always has the following properties:
They are always 400×400 pixels with a white background. (It may not be exactly white since SE images are lossily ... |
I like to save time quite literally, by wearing three watches on my wrist... Problem is they each give a different time. One watch is x minutes behind the actual time. One watch is x minutes ahead of the actual time. The last watch shows the actual time.
Problem is, I can't tell which watch has the correct time...
Fro... |
Mash Up Time!
This is instalment #5 of both my Random Golf of the Day and Optimizer's ASCII Art of the Day series. Your submission(s) in this challenge will count towards both leaderboards (which you can find the linked posts). Of course, you may treat this like any other code golf challenge, and answer it without worr... |
You should write a program which receives two strings as input and outputs a sequence of movements which rearrange the first string into the second. You should use as few moves as you can.
Both strings will contain only lowercase letters and the second (goal) string is a permutation of the first (original) one.
Every m... |
RoboCritters (etymology) is a brand new esoteric programming language (don't bother searching for it, I just invented it). It's a variant of Brainfuck (BF), slightly more complex than the usual operator substitution schemes. Every program in RoboCritters is a rectangular grid of text that only contains the seven charac... |
COMPLETE
Wumpus season has ended, and with, the lives of many a vicious Wumpus and brave Hunter. As well as some cowardly, immoral and downright stupid Hunters. But at the end of the day, NascarHunter by Dr Heckle came away with the most loot and glory. We salute you, oh brave... driver?
It's open season on Wumpuses, a... |
This isn't as much a "challenge" as "a unique problem that there are no built-in functions to solve." Basically, you need to do this:
Read some lines of numbers from stdin. These lines may contain trailing or preceding whitespace, and there may be empty lines. No lines will contain "just whitespace" other than a newli... |
Introduction
This challenge is about three (bad) sorting algorithms: Bogosort, and two others variants that I came up with (but have probably been thought of by others at some point in time): Bogoswap (AKA Bozosort) and Bogosmart.
Bogosort works by completely shuffling the array randomly and checking if it becomes sor... |
Have a look at this ascii art diagram of various boxes:
+--------------------------------------------------------------+
| |
| +-------------------------------+ +-------+ |
| | | | | |
| ... |
Write a program that takes one integer input n and one format letter and outputs n autograms in the format This sentence contains ? "A"s, ? "B"s ... and ? "Z"s.
Each question mark ? represents the number of times the the following letter appears in the text
All numbers will be written as text. To make it equally unfai... |
I promise, this will be my last challenge about diamong tilings (for a while, anyway). On the bright side, this challenge doesn't have anything to do with ASCII art, and is not a code golf either, so this is actually completely different.
So just as a reminder, every hexagon can be titled with three different diamonds:... |
The goal of this challenge is to (eventually) output every possible halting program in a language of your choice. At first this may sound impossible, but you can accomplish this with a very careful choice of execution order.
Below is an ASCII diagram to illustrate this. Let the columns represent a numbering of every ... |
Introduction
Partly inspired by this StackOverflow question, let's draw an ASCII Lightning Bolt.
Write a program that takes a positive Integer n via STDIN or command line and outputs the ASCII Lightning Bolt below.
Input
Positive Integer n representing the number of lightning zig-zag tiers to draw.
Example Output
n=1
_... |
The challenge is this:
You are given a url that is as follows:
http://sub.example.com/some/dir/file.php?action=delete&file=test.foo&strict=true
There can be either http or https, there can be any number of subdomains or directories, and the end file can have any name.
You are to create a full program (that can be comp... |
Introduction
Hex is a strategy board game played on a hexagonal grid, theoretically of any size and several possible shapes, but traditionally as an 11×11 rhombus. Other popular dimensions are 13×13 and 19×19 as a result of the game's relationship to the older game of Go. According to the book A Beautiful Mind, John Na... |
Write a program that takes in a string of the four characters ()[] that satisfies these points:
Every left parenthesis ( has a matching right parenthesis ).
Every left bracket [ has a matching right bracket ].
Matching pairs of parentheses and brackets won't overlap. e.g. [(]) is invalid because the matching brackets ... |
In this challenge, you have to implement a basic spell checker and autocorrector. Your program will use the first input as a source for a dictionary of words, and will use that to autocorrect the second input, finding a close match to some incorrectly spelt words, outputting the result
Specifications
You will receive ... |
Here is a list of 1000 basic English words. Yes, I'm aware that there are only 997 words in the list! It was taken from Wiktionary so blame them!
Your task is to write a program that accepts a word and returns TRUE or FALSE (or 0 or 1) depending on whether the word is in the list or not. You must use the spelling as it... |
What general tips do you have for golfing in sed? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to sed (e.g. "remove comments" is not an answer).
Please post one tip per answer.
|
Consider the following standard 15×15 crossword puzzle grid.
We can represent this in ASCII art by using # for blocks and (space) for white squares.
# #
# #
#
# #
### ## ##
## #
# #
# ##
## ## ###
# #
# ... |
When working on Non-Palindromic Polyglot Boggle, I found it quite tedious to pack the codes as efficiently as possible onto the Boggle board, even with only two strings. But we're programmers, right? We know how to automate things.
Given a list of strings, you're to generate a Boggle board on which each of those string... |
Liar's Dice is a fairly simple dice game. I've seen a few different variations of the rules, but here is the version I'm most familiar with:
Each player starts with 5d6
Except when tallying the dice at the end of a round, each player may see their own dice, but not those of any opponent
At the start of any given round... |
Aim
If you are given a sequence such as (A, G, M, _, _, C, D, _, G) your aim is to push all non empty elements to one side to get (A, G, M, C, D, G, _, _, _). You must preserve the order of the non-empty elements.
Rules
You are free to choose the sequence type. (strings, numbers, containers etc). You must also choose ... |
Remember those fun pinwheels that you blow on and they spin round and round? Let's code one!
A pinwheel will have the set of characters \ | / _ drawing its center and arms. One possible pinwheel could look like this:
|
|
|_ ___
___|_|
|
|
|
But what's a pinwheel that doesn't spin? No fun... |
There is a nice way to perform long multiplication for two integers without having to do anything but counting, which occasional gets shared around the internet. You write the digits of each number as a bunch of slanted lines, with the two numbers at a 90 degree angle. Then you can simply count the intersections in the... |
Background
The Burrows–Wheeler transform (BWT) is a reversible permutation of the characters of a string that results in large runs of similar characters for certain types of strings such as plain text. It is used, for example, in the bzip2 compression algorithm.
The BWT is defined as follows:
Given an input string suc... |
In this challenge you will write a program that takes two newline-separated strings, s1 (the first line) and s2 (the second line), as input (STDIN or closest). You can assume that the length of s1 will always be smaller than 30 and bigger than the length of s2. The program should then output each step in the levenshtei... |
This task is about writing code to compute a probability exactly. The output should be a precise probability written as a fraction in its most reduced form. That is it should never output 4/8 but rather 1/2.
For some positive integer n, consider a uniformly random string of 1s and -1s of length n and call it A. Now con... |
The Hourglass
This hourglass has 60 "sands of time", and it completely fills each chamber. The clock is 19 characters wide and 13 characters in height. Each chamber has 5 rows of sand and there is a row in the centre that can hold 1 sand. The top row can hold 17 sands, the next one 15 and so on (see below). Sands fall ... |
Goal:
The goal of this challenge is to take a simple 6 row by 6 column XML file (without the standard XML header) and parse it out so that the program can return the value of a cell given it's coordinates.
The entry with the shortest overall length by language and overall will be declared the winner.
Additional informa... |
[This is a partner question to Calculate a probability exactly ]
This task is about writing code to compute a probability exactly and quickly. The output should be a precise probability written as a fraction in its most reduced form. That is it should never output 4/8 but rather 1/2.
For some positive integer n, consid... |
You have a 3x3 grid. Each cell can be colored black or white. Display all 512 of these colorings. Fewest bytes wins.
You can display the grids in any formation as long as they are visually separated and the spacing looks regular. You may use ASCII art or images. Any two distinct visible symbols or colors can be used fo... |
Write a program that takes in a non-empty string of the digits 0 through 9 and prints how they would be shown on a seven-segment display using slashes (/, \).
These are the precise digit shapes:
/\
\ \
\/
\
\
/\
/
\/
/\
/\
/
\
\/\
/
\/\
/
/
\/\
\/
/\
\
/\
\/\
\/
/\
\/\
/
When one digit oc... |
Imagine a W by H grid of squares that wraps toroidally. Items are placed onto the grid as follows.
The first item can be placed on any square, but subsequent items must not be within a Manhattan distance R of any previous item (also known as a Von Neumann neighbourhood of range R). Carefully choosing the positions allo... |
A common optimization to save space in binaries is to merge string literals where one literal is the suffix of another. For instance, a binary with the string literals
a: foobar
b: bar
c: barbaz
d: foobarbaz
e: baz
might contain the following string literal pool (# representing the \0-terminator):
foobar#foobarbaz#
w... |
It was a warm summer evening...
when my stupid car decided to break down in the middle of the road on my way back from the supermarket. I pushed it to the sideline and decided to walk home. I opened the trunk to take out the grocery and remaining stuff. It was then that I noticed the items were not evenly bagged. Some ... |
Introduction
In the error outputs of some languages such as Java, a pointer is shown to give the programmer an idea of exactly where the error went wrong.
Take this example on Ideone:
Main.java:12: error: ';' expected
Invalid Java!
^
Notice the caret shows where the invalid code is?
Challenge
Your... |
Randall Munroe's book "xkcd, volume 0" uses a rather odd number system for the page numbers. The first few page numbers are
1, 2, 10, 11, 12, 20, 100, 101, 102, 110, 111, 112, 120, 200, 1000, 1001, ...
This looks a bit like ternary, but notice that he skips from 20 straight to 100, from 120 to 200 and from 200 to 1000... |
In Minecraft, the default item textures are all reasonably simple 16×16 pixel images, which makes them seem ideal for golfing.
Below are simplified textures of the five "core" diamond tools in Minecraft: pickaxe, shovel, axe, sword, and hoe.
The images shown are enlarged to show their detail. Click on an image to view ... |
Your task is to generate boxes using any one ASCII character with respect to the inputs given.
Test Cases
1 1 --> =====
= =
=====
1 2 --> =========
= = =
=========
2 1 --> =====
= =
=====
= =
=====
2 2 --> =========
... |
Your task is to determine whether a graph is planar.
A graph is planar if it can embedded in the plane, or in other words if it can be drawn without any crossing edges.
Input: You will be given an undirected graph in your choice of the following formats:
Edge list, e.g. [(0, 1), (0, 2), (0, 3)]
Adjacency map, e.g. {0:... |
You should complete four tasks in a language which:
must return no results* when searched for on this (codegolf.se) website, for example ToffeeScript;
must have a page listed at Esolang, Rosetta Code or Wikipedia;
be a distinct language, rather than a distinct version (e.g. python 2.1 would be valid iff python satisfi... |
Introduction
Lately, I've been getting used to typing with Swype.
I've noticed certain words can be produced by drawing a straight line from your starting letter to your ending letter, or by skipping letters that repeat.
For example, I can type the word balloon by Swyping across the following letters:
b > a > l > o > n... |
Welcome back! I'm excited to present the 3rd CodeBots challenge. This one has been a long time in the making. This challenge will be split up in 3 sections: the short version, the long version, and additional details.
The Short Version
Each competitor will write a 24-command program. These bots will move around the ... |
I previously asked a question for how to compute a probability quickly and accurately. However, evidently it was too easy as a closed form solution was given! Here is a more difficult version.
This task is about writing code to compute a probability exactly and quickly. The output should be a precise probability writ... |
Fed up with experimenting on tiny domestic animals, Nobel prize-winning Erwin Schrödinger has decided to find the nearest laser and shoot it at things instead. Because... science!
Description
You will be given two points that the laser passes through and the size of a laser beam, and you must determine where the laser ... |
Compute 30000 digits of the mathematical constant π, with the fastest code.
Implement in any computer programming language that I can run in my 64 bit Linux machine. You should provide your compiler optimization options if any. I am ready to install a new compiler or language runtime to run your code, given that I am n... |
Ok, my first golf question. Please be gentle :) I know there's way too many ascii puzzles :P but here we go.
The task is simple, use your favorite programming language to print a triangle ripple. The input should be the size of the ripple.
Each triangle is evenly spaced out. Basically, you keep adding the triangles unt... |
A peer of mine approached me with this challenge and I wasn't able to come up with an elegant solution. After discussing my approach, we began to wonder what the people at Code Golf would come up with.
Given
A processor that implements only two instructions:
STO <register>, <address> (store from this register to this... |
A little genetics lesson
When you only have access to someone's visible traits or phenotype, a pedigree of their family history is often used to figure out the actual genetic information or, genotype of each family member.
When dealing with simple dominance as we will be, a simple pedigree chart will be enough to figu... |
It seems that simple changes to a C++ file, especially with templates, can generate pages of errors. This contest is to see what the largest "bang of the buck" is, that is the more verbose error output with the smallest change to the source code (1 character addition).
Because other languages are more sane, this will b... |
The word BANANA appears exactly once in this word search:
B A N A A N B B
A B A N A B A N
A N A B N N A A
N N B A A A N N
N A A N N N B A
A N N N B A N A
N A A B A N A N
B A N A N B B A
The word search above contains only one occurrence of the word BANANA looking up, down, left, right, or diagonally, but it has lot of... |
This is a King of the Hill challenge in a round robin. It's a battle to find the best gunman of the west!
To be able to compete in this contest you need to make two functions. The first one sets the attributes of your gunman and the second is the main logic function for the gunman.
Attribute Function
function () {
... |
Your program must take an alpha/numeric input string and print it sideways (rotated 90 degrees clockwise). So for example, HI, would become:
#####
#
#####
#####
Rules:
The shortest code wins. For the sake of objectivity this will be the standard font. The input still only has to be alpha-numeric. Capitalization doe... |
Consider an array of integers:
[1, 0, 9, 1, 3, 8]
There are a lot of ways to partition this list into consecutive sublists. Here are three:
A: [[1, 0, 9], [1, 3, 8]]
B: [[1], [0, 9], [1, 3], [8]]
C: [[1, 0], [9, 1], [3, 8]]
We will call a partition Y and refinement of another partition X if X can be obtained from Y b... |
So,
My friend has come up with this interestng question, that is, given two numbers x and y deciding whether their difference: x-yis 0 or less without using any conditionals. The code should return 0 if they are 0 or less, or the result of the subtraction otherwise.
My attempt (In Pseudo-Java):
try {
Math.log(x-y);
} c... |
Background
A Pythagorean triangle is a right triangle where each side length is an integer (that is, the side lengths form a Pythagorean triple):
Using the sides of this triangle, we can attach two more non-congruent Pythagorean triangles as follows:
We can continue with this pattern as we see fit, so long as no two ... |
Pazaak is a card game from the Star Wars universe. It is similar to BlackJack, with two players pitted against each other trying to reach a total of twenty without going over. Each player has a "side deck" of four cards of their own that they can use to modify their score.
Leaderboard
As of 6/17/2015 @ 16:40 EDT
Edit: ... |
Background
Yes, bitstring physics is a real thing.
The idea is to construct a new theory of physics using only strings of bits that evolve under a probabilistic rule... or something.
Despite reading a couple of papers about it, I'm still pretty confused.
However, the bitstring universe makes for a nice little code golf... |
Tupper's Self-Referential Formula (copied from Wikipedia)
Tupper's self-referential formula is a formula defined by Jeff Tupper that, when graphed in two dimensions at a very specific location in the plane, can be "programmed" to visually reproduce the formula itself. It is used in various math and computer science cou... |
This challenge is NinjaBearMonkey's prize for winning my Block Building Bot Flocks! challenge with the Black Knight submission. Congratulations NinjaBearMonkey!
The challenge here is fairly simple, but has a variety of possible approaches. The story goes that in the world of Isometric Illusions, there are 6 different t... |
The process of Reversal-Addition is where a number is added to it's reverse until the number created is a palindrome. For example, if we start with 68, the process would be:
$$68 + 86 \to 154 + 451 \to 605 + 506 \to 1111$$
As you can see, this took 3 additions to get to a palindromic number. If we were to start with \$... |
Semiperfect numbers
A semiperfect/pseudoperfect number is an integer equal to the sum of a part of or all of its divisors (excluding itself). Numbers which are equal to the sum of all of their divisors are perfect.
Divisors of 6 : 1,2,3
6 = 1+2+3 -> semiperfect (perfect)
Divisors of 28 : 1,2,4,7,14
28 = 14+... |
A linear Diophantine equation in two variables is an equation of the form ax + by = c, where a, b and c are constant integers and x and y are integer variables.
For many naturally occurring Diophantine equations, x and y represent quantities that cannot be negative.
Task
Write a program or function that accepts the coe... |
In schools across the world, children type a number into their LCD calculator, turn it upside down and erupt into laughter after creating the word 'Boobies'. Of course, this is the most popular word, but there are many other words which can be produced.
All words must be less than 10 letters long, however (the diction... |
In typography, a counter is the area of a letter that is entirely or partially enclosed by a letter form or a symbol. A closed counter is a counter that is entirely enclosed by a letter form or symbol. You must write a program takes a string as input and prints the total number of closed counters in the text.
Your inp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.