instruction stringlengths 34 53.1k |
|---|
Challenge Taken with permission from my University Code Challenge Contest
After finishing her studies a couple of months ago, Marie opened a bank account to start receiving the payment of her first job in town. Since then she has been performing a few transactions with it. Her first payment was $1000 dollars. With tha... |
You've probably heard of Fibonacci numbers. Ya know, that integer sequence that starts with 1, 1, and then each new number is the sum of the last two?
1 1 2 3 5 8 13...
And so on. Challenges about Fibonacci numbers are pretty popular 'round here. But who says that the Fibonacci numbers have to start with 1, 1? Why cou... |
A radiation-hardened quine can take a hit and stay standing, but nobody ever said that the quine can't be a wuss about it.
For this challenge, you should write a quine that:
If no characters are removed, prints its source code normally.
Iff any one character is removed, prints the original program's source code, follo... |
Pretty simple challenge here. Who can make the fastest algorithm (lowest time complexity) to determine whether or not the circle is "boxed in" given the following setup?
Input: Your program receives a pair of numbers (a,b) that denotes the position of a circle on a grid like this with arbitrary dimensions:
Where a-1 i... |
Challenge Taken from my university code challenge contest
This is actually Day 0 but yesterdays' challenge was too easy and can be a dupe of another question here.
Tetris is a video game that became popular in the 80s. It consists of placing a series of pieces with different shapes that fall on a board, so that they f... |
Notwen wants to study the kinematics of bodies thrown from big heights in a uniform gravitational field but unfortunately he doesn't have the technical possibility to go to sufficiently high places and observe the objects while falling. But who doesn't want to see advances in science so... Let's help Notwen build a gra... |
Sorry folks, but what I've got for you today is a golf but just limited by JS (or, to be strict, for a day of posting - an ES6 - the most modern set of it - if its ES7 - feel free to EDIT! use MOST MODERN features).
So if you afford that restriction - let's proceed!
Assume we have JSON root data structure r and some gl... |
Single moves
The board is an infinite 2 dimensional square grid, like a limitless chess board. A piece with value N (an N-mover) can move to any square that is a distance of exactly the square root of N from its current square (Euclidean distance measured centre to centre).
For example:
A 1-mover can move to any squar... |
Your task is to write a program, function or snippet (yes, snippets are allowed) that simply outputs an integer. However, you must be able to separate your submission into prefixes that also produce distinct integers. You cannot use any bytes that have appeared in previous prefixes. For example, we can have the prefixe... |
Your job is to create the longest period iterating quine, where the length of each program in the sequence is bounded by 500 bytes.
That is, if you repeat the following steps:
Start with your initial program
Run the current program
Go back to step 2
You will eventually get back to your original program. The number of... |
This challenge is pretty simple: you need to alert / print / show to the user the text "beep boop bop" (or "beep\nboop\nbop", with newlines), but it needs to be obfuscated. (where you couldn't see anything saying "beep", "boop", or "bop"). Points are calculated where your point value is in characters (not bytes)
|
Derived from this, now deleted, post.
Given a string, answer (truthy/falsy or two consistent values) if it constitutes a good Bishop password, which is when all the following conditions are met:
it has at least 10 characters
it has at least 3 digits ([0-9])
it is not a palindrome (identical to itself when reversed)
Y... |
Here's the challenge. Write some code to output all the integers in a range. Sounds easy, but here's the tricky part. It will start with the lowest number, then the highest. Then the lowest number which isn't yet in the array. Then the highest which isn't yet in it.
Example:
Lets take 1 to 5 as our start
The numbers ... |
Given a possibly nested, non-empty array of single-digit positive integers (not guaranteed unique), output the ASCII-art representation as a tree, using the box-drawing characters ┌ ┴ ┐ ─ │ ┬ ┼. (These were copied from Code Page 437, but you can use any equivalent representation).
Every integer of the array should be a... |
Not to be confused with Password Bishop Goodness!
Given a string, answer (truthy/falsy or two consistent values) if it constitutes a password which is strong against bishops.
A password is strong against bishops if it is a string consisting of alternating letters (in a-h) and digits (in 1-8) such that each pair of char... |
Your task is to create the shortest program (A) that outputs another program (B) with the most unique bytes, which in turn outputs the original program (A). Essentially, you are golfing one half of a pair of ouroboros programs (a.k.a. periodic iterating quine) and bowling the other half. A and B may be in different lan... |
Related to this question.
A room is defined to be a (not necessarily convex) non-intersecting polygon, expressed as an ordered list of 2-dimensional coordinates. A sufficiently bright lightbulb is placed at a specific point inside the room, and emits light in every direction. Your task is to find the total illuminated ... |
Challenge:
Here we have the first 100 items of a sequence:
6,5,4,3,2,1,66,65,64,63,62,61,56,55,54,53,52,51,46,45,44,43,42,41,36,35,34,33,32,31,26,25,24,23,22,21,16,15,14,13,12,11,666,665,664,663,662,661,656,655,654,653,652,651,646,645,644,643,642,641,636,635,634,633,632,631,626,625,624,623,622,621,616,615,614,613,612,6... |
The task is a rather simple quine challenge with a twist, you must output your source code in the shape of a pyramid. The shape of a pyramid is defined below:
1
234
56789
ABCDEFG
HIJKLMNOP
QRSTUVWXYZa
bcdefghijklmn
......etc......
The main limitation of this challenge is that your quine mus... |
Challenge Taken with permission from my University Code Challenge Contest
The dependence we have on mobile phones makes us charge them every night up to the maximum level of the battery, so we do not run the risk of running out of power by the middle of the next day. There are even people who, when they see a free out... |
Spirals are cool , so are numbers, and number spirals are even cooler. But what if I want a specific number, in a specific place using xy coordinates...
Challenge
Using an infinite spiral moving down first, curling in a counterclockwise manner
ex:
6 5 4
7 0 3
8 1 2
9 10 11
Take negative and positive inputs(... |
I recently decided to download some dictation software, in order to help with my writing. However, it doesn't work very well when I'm coding, since I have to change from saying words to symbols and back again. It's even worse when I'm coding in an esoteric language which is all symbols.
In order to make my use of the d... |
"Baby Shark" is a children's song about a family of sharks. Having long been popular as a campfire song, it has been popularized since the mid-2000s by social media, online video and radio. - Wikipedia
Write program that takes no input, and writes the following text to the standard output or an arbitrary file:
Baby S... |
Make a program that takes a length and list of intervals and outputs a ruler of that length with longer ticks for each interval using the line drawing characters ┌ ┬ ┐ │ ╵
The first row of the output should begin with the tick for 0 with ┌ and end with a tick for the length with ┐, with a ┬ being used for every charac... |
Given a list of date ranges r as input, output or return any ranges not found in r.
For the sake of this example, input will be in YYYY-MM-DD format.
Let's say you have three date ranges:
[2019-01-01, 2019-02-01]
[2019-02-02, 2019-04-05]
[2019-06-01, 2019-07-01]
You can see that there is a gap in between 2019-04-05 an... |
Sorting makes no sense for a 2-dimensional array... or does it?
Your task is to take an input grid and apply a bubble-sort-like algorithm to it until all values in the grid are non-decreasing from left to right and top to bottom along every row and column.
The algorithm works as follows:
Each pass goes row by row, top... |
At a party, I was introduced to the game LCR. Now it's not a great game as there's no skill but only random chance. But it got me thinking, I could code this, and I made a quick program in R to model the game.
Rules of the game modified from Wikipedia to match how we played:
Each player receives at least 3 chips. Pla... |
Inspired by, and in memory of, our beloved genius,
R.I.P.
He invented and implemented dfns — his magnum opus and the subject of the challenge.
For the interested: latest full dfns documentation and videos with John.
Task
Given an ASCII source code, answer in which of the following four categories it belongs:
Dyadic d... |
tl;dr? See bottom for The Competition
Integer literals
While programming, the 64-bit hexadecimal literal 0x123456789abcdefL is difficult to gauge the size of. I find myself mentally grouping digits from the right by fours to see that it's 15 digits' worth.
Python PEP 515 allows you to express the above literal, insid... |
In sporting competitions, it often happens that winners are presented on podiums, with the first-place person on the highest in the middle, the second-place person on the middle height to the left, and the third-place person on the lowest and to the right. We're going to recreate that here with some special tweaks.
The... |
sandbox (deleted)
Lets define a matrix of 9s as:
$$ N = \begin{bmatrix} 9&9&9\\9&9&9\\9&9&9 \end{bmatrix} $$
Lets define an exploding number as a number at position \$(x,y)\$ that can be decomposed into equal integers between all its adjacent neighbors (including itself) and the absolute value of each portion is great... |
Can this container hold this much liquid?
Challenge Synopsis
As you most likely know, liquids have an indefinite shape and a definite volume. As such, they always take the shape of their container. They cannot, however, expand to fill their container.
Your job today is to determine whether or not a certain amount of li... |
Challenge
Return the full contents of your program, but inverted. How do your invert something? Well,
Letters: Take the position of the letter in the alphabet, subtract from 26, and use the letter at that position and flip the case of the letter. E.g A becomes z, and p becomes J.
Digits: Subtract from 9. E.g 6 becomes ... |
Introduction
In order to prevent keyloggers from stealing a user's password, a certain bank account system has implemented the following security measure: only certain digits are prompted to be entered each time.
For example, say your target's password is 89097, the system may prompt them to enter the 2nd, 4th and 5th ... |
Challenge
Input:
An integer \$b\$ between 2 and 62 (inclusive).
Output:
Count from \$1\$ to the equivalent of \$5000_{10}\$ in base \$b\$, using any reasonable representation for the digits.
However:
If the number is divisible by \$\lfloor b÷2+1\rfloor\$ (rounded down, e.g base 7 would be 7/2=3.5, 3.5+1=4.5, rounded t... |
Your task is to create a program where if any one character is deleted, it will detect which character was deleted and then re-insert the deleted character in its own source file.
For instance, if your program is RadiationHardened and it is modified to RadiaionHardened, then your program must output that the 5th byte (... |
You will receive an array and must return the number of integers that occur more than once.
[234, 2, 12, 234, 5, 10, 1000, 2, 99, 234]
This will return 2, since each of 234 and 2 appear more than once.
[234, 2, 12, 234]
[2, 12, 234, 5, 10, 1000, 2]
The list will never be more than 100k integers long, and the integer... |
Write a program or function that, when given a string, filters out as many distinct bytes as it can and returns the cleaned string. However, since your program hates them, none of these bytes can be present in your own code.
Your score will be the number of distinct bytes your program filters out from the input, with t... |
Below Python code generates memory leak.
Challenge: Fix the memory leak with minimal changes to the code as measured by Levenshtein distance to the original code. You may only change the code before t is initialised. When the del t line is removed the modified program should print I'm still alive! every second.
PS: I ... |
Given a decimal number k, find the smallest integer n such that the square root of n is within k of an integer. However, the distance should be nonzero - n cannot be a perfect square.
Given k, a decimal number or a fraction (whichever is easier for you), such that 0 < k < 1, output the smallest positive integer n such ... |
As you may know, the typical binary floating point numbers in a computer language are quite different than the typical integer numbers in a computer language. Floating point numbers can represent a much larger range, and can represent fractional amounts, however there is a trade-off that is frequently elided.
The dista... |
You will receive an integer less than 2000000000 and bigger than -2000000000 and you have to test what type(s) of number this is out of:
Factorial
Square
Cube
Prime
Composite
Triangular
Positive
Negative
Here is a definition of all the different types of numbers:
Factorial - A number That is equal to the product of a... |
There's a little improv warm up game where you arrange yourselves in a circle and send zips, zaps, and zops around by pointing to a person and saying the next word in the sequence, then they do the same until all of you are warmed up or whatever.
Your task is to create a program that gives the next word in sequence giv... |
Goal
Write a program or function that takes a positive integer n and randomly generate a legal series of pitches (henceforth called a Pitch string) of length n.
Input
A non-zero, positive integer n <= 100
Output
Return a random string, or list of characters, that represent a possible, valid pitch string of length n. Th... |
For a while now, I've been running into a problem when counting on my fingers, specifically, that I can only count to ten. My solution to that problem has been to count in binary on my fingers, putting up my thumb for one, my forefinger for two, both thumb and forefinger for three, etc. However, we run into a bit of ... |
Hold up..... this isn't trolling.
Background
These days on YouTube, comment sections are littered with such patterns:
S
St
Str
Stri
Strin
String
Strin
Stri
Str
St
S
where String is a mere placeholder and refers to any combination of characters. These patterns are usually accompanied by a It took me a lot of time to m... |
Suppose you have a string \$s_0\$ and someone else has a hidden string \$s_1\$. You don't know what \$s_1\$ is but they tell you that they can get from your string, \$s_0\$, to their string by making a certain number of moves \$d\$. Each move can be one of the following:
Insertion : Add a character anywhere in the ... |
Introduction:
Inspired by a discussion that is already going on for many years
regarding the expression \$6÷2(1+2)\$.
With the expression \$6÷2(1+2)\$, mathematicians will quickly see that the correct answer is \$1\$, whereas people with a simple math background from school will quickly see that the correct answer ... |
Background
MENACE (Machine Educable Noughts And Crosses Engine) is a rudimentary shallow machine learning algorithm for the game Noughts and Crosses, created by British computer scientist Donald Michie in the 1960s. It was originally implemented with 304 matchboxes, each labelled with a board position and containing co... |
A jumping number is defined as a positive number n which all pairs of consecutive decimal digits differ by 1. Also, all single digit numbers are considered jumping numbers. eg. 3, 45676, 212 are jumping numbers but 414 and 13 are not. The difference between 9 and 0 is not considered as 1
The challenge
Create a program ... |
I was browsing Stackoverflow and saw this question about tiling an MxN rectangle, and I thought it would be great for golfing. Here is the task.
Given the dimension M and N, write a program that outputs how many unique ways a MxN rectangle (N is the number of rows, not columns. Not that it really matters) can be tiled ... |
So I ran into this progressive/idle game cleverly called Idle Dice. Has a variety of random effects applied to a pretty typical progression formula game. Warning, time sink! Play at your own risk.
However after you have 5 dice (summed the usual way) along with some bonuses for various matches (pair, two pair, three of ... |
A very simple golf this time, but should be fun to do.
Challenge
Output your code, but rotated 45 (or -45) degrees. E.g:
lorem ipsum dolor sit amet
becomes
t
e
m
a
t
i
... |
Your task is to take an array of numbers and a real number and return the value at that point in the array. Arrays start at \$\pi\$ and are counted in \$\pi\$ intervals. Thing is, we're actually going to interpolate between elements given the "index". As an example:
Index: 1π 2π 3π 4π 5π 6π
Array: [ 1.1, 1... |
Gringotts isn't just a vault, but a reputable financial institution and wizards need loans too. Since you don't want to be screwed over by the Gringotts goblins, you decided it would be a good idea to write a program to calculate interest. Interest is compounded only yearly.
Your task is to calculate total owed amount ... |
Given a truth table and two images, use the truth table as a bitwise operation to the two images.
For example with the truth table:
1 0
1 0 0
0 1 0
(Note that the top is the first image and the left is the second)
and the two images (0, 2, 4) (a 1x1 image, with the numbers being RGB values) and (30, 20, 10):
You wou... |
This function should take four integer inputs (a,b,c,d) and return a binary word based on which values equal the maximum of the four.
The return value will be between 1 and 0xF.
For example:
a = 6, b = 77, c = 1, d = 4
returns 2 (binary 0010; only 2nd-least significant bit is set corresponding to b being sole max value... |
Your program should find the number of string pairs (pairs of 2) that contain all vowels (a e i o u), when given an integer N and N strings.
There are easy ways to do this, but I'm looking for the quickest possible solution.
Example:
INPUT:
4
password
unique
orbiting
ointmental
OUTPUT:
2
EXPLANATION:
password has a,o... |
A store is having a big sale.
If your price reaches $199 or more, you can reduce it by $100.
You can buy each product only once.
Here's an example list of products: (in order to simplify, the names of the products are represented by letters)
+------+-------+
| name | price |
+------+-------+
| A | 26.9 |
| B | 2... |
Background
For this challenge, a 'metasequence' will be defined as a sequence of numbers where not only the numbers themselves will increase, but also the increment, and the increment will increase by an increasing value, etc.
For instance, the tier 3 metasequence would start as:
1 2 4 8 15 26 42 64 93 130 176
because:... |
I haven't been on PP&CG for a while, so I thought I would post something!
Your task is to find how "smooth" a natural number is. Your method is to:
1: Convert the number to binary
2: Find the number of changes / switches
3: Find the length of the string (in binary)
4: Divide length by changes
So, an example. 5.
Sta... |
Imagine this short function to clamp a number between 0 and 255:
c = n => n > 0 ? n < 255 ? n : 255 : 0
Is this the shortest possible version of a clamp function with JavaScript (without ES.Next features)?
P.S: Not sure if it's relevant but, the 0 and 255 are not random, the idea is to clamp a number as an 8-bit unsig... |
Your task is to write a program which given an array and a number, you need to split the array into chunks with size is number.
Rules
Your program will receive an array A , as well as a positive integer n. The array should then be split into chunks of length n, if the length of the string isn't divisible by n any left... |
In association football (also known as soccer), a penalty shoot-out is the second tie-breaker measure that may be used in a match which can't end in a tie, after extra time (i.e. association football overtime).
In a penalty shoot-out, the main referee tosses a coin to determine at which goal the shoot-out happens, and ... |
Tonight is card game night! You are the dealer and your task is to write a program to deal the cards to the players.
Given an array of cards and the number of players, you need to split the array of cards into a hand for each player.
Rules
Your program will receive an non-empty array A , as well as a non-zero positive... |
Input
A string.
Output
The sum of all integers in the line.
Constraints
1≤Length of line≤500
Sample test Case
Input
the 5is 108 seCONd4 a
Output
117
Explanation
Sum is: 5+108+4=117
|
Input:
An integer \$n\$, which is guaranteed to be \$\ge3\$.
An integer \$d\$, which is one of \$[-1,0,1]\$.
Output:
A road of size \$n\$, which will be in a north-west direction if \$d=-1\$; a north direction if \$d=0\$; or a north-east direction if \$d=1\$. The road will always be three spaces wide (or five in gene... |
Task:
Given an integer input, figure out whether or not it is a Cyclops Number.
What is a Cyclops number, you may ask? Well, it's a number whose binary representation only has one 0 in the center!
Test Cases:
Input | Output | Binary | Explanation
--------------------------------------
0 | truthy | 0 | only ... |
Problem Description
We all love a Twix (because it is the best candy), but this is the kids' first Halloween --- we gotta grab at least one of each type of candy for them. Each Halloween all the residents of Numberline avenue send out an email saying what types of candy they'll be giving away this year.
Oh! And we live... |
Challenge
This challenge will have you write a program that takes in two integers n and m and outputs the number non-intersecting loops on the n by m torus made by starting at (0,0) and only taking steps up and to the right. You can think of torus as the grid with wraparound both at the top and the bottom and on the si... |
I came across this challenge from codewars. I wish to know how to solve this problem. The problem description is given below.
Its elements are in range[1..n^2]. The matrix is filled by rings, from the outwards the innermost. Each ring is filled with numbers in the following way:
The first number is written in the top ... |
Employers love to see their employees working hard, while the employees would love to work less, especially those with a monthly rather than hourly payment.
The laziest of employees are thinking about the world where every month starts with the same weekday and it makes them wonder if they would work more or less.
T... |
A permutation of a set \$S = \{s_1, s_2, \dotsc, s_n\}\$ is a bijective function \$\pi: S \to S\$. For example, if \$S = \{1,2,3,4\}\$ then the function \$\pi: x \mapsto 1 + (x + 1 \mod 4)\$ is a permutation:
$$
\pi(1) = 3,\quad
\pi(2) = 4,\quad
\pi(3) = 1,\quad
\pi(4) = 2
$$
We can also have permutations on infinite s... |
Introduction
Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all positive numbers.
The first challenge in this series is to output a(n) for a given n as input, where a(n) is A064413, also known as the EK... |
Challenge:
Input: A list of distinct positive integers within the range \$[1, \text{list-size}]\$.
Output: An integer: the amount of times the list is riffle-shuffled. For a list, this means the list is split in two halves, and these halves are interleaved (i.e. riffle-shuffling the list [1,2,3,4,5,6,7,8,9,10] once wou... |
A string is dot-heavy when its morse representation contains more dots than dashes. For example, the letter E is a single dot, which means it is Dot-heavy.
Input
The input string will only contain characters in the range of [a-z] or [A-Z]. You can decide if they should all be upper case, or all lower case. AAA is fine... |
Background:
The current Perfect Numbers challenge is rather flawed and complicated, since it asks you to output in a complex format involving the factors of the number. This is a purely decision-problem repost of the challenge.
Challenge
Given a positive integer through any standard input format, distinguish between wh... |
This is a simple challenge.
The task is to write code that outputs a 448*448 square image with 100% transparency. The output should follow the standard image rules.
|
Given a number 1≤n≤365, output the nth day of the year in "Day-numberth Month" format. For example, given 1, you should output "1st January", without "of".
The Gregorian calendar will be used and the program should not account for leap years, so your program should never output "29th February" in any circumstance. Any ... |
This is an answer chaining puzzle, where each answer must add on to the last.
The \$n\$th submission must output its own source code in the \$n\$th language and the \$n−1\$ languages before it.
A language can be either a dialect or a major version of a language, so Python version 2.121 is only counted as version 2 and ... |
Problem statement
Pólya is playing about with his urn again and he wants you to help him calculate some probabilities.
In this urn experiment Pólya has an urn which initially contains 1 red and 1 blue bead.
For every iteration, he reaches in and retrieves a bead, then inspects the colour and places the bead back in the... |
Challenge
Design a compression algorithm specialized for compressing ASCII mazes. You will need to create both a compression algorithm and a decompression algorithm. Your score will be based on the size of your compressed mazes.
Mazes
These mazes are made primarily of the characters (floors), +, -, |, and # (walls), a... |
Rectangles have this nice property - an \$n \times m\$ rectangle consists of exactly \$n \times m\$ characters!
A.. more interesting property is that the rectangles can be aligned nicely in a multiplication table - for example, a \$3 \times 3\$ table:
# ## ###
# ## ###
# ## ###
# ## ###
# ## ###
# ## ###
Your challe... |
Background
Though this is a bit late for Pi Day, I saw an article about Pilish and thought it would make a great challenge. Pilish is created by using a sequence of words where each word's length corresponds to a digit of pi.
Example from Wikipedia:
The following Pilish poem (written by Joseph Shipley) matches the fir... |
So, you have a random list (random meaning it doesn't matter what order it is in) of numbers with a length of n, where n is a positive integer smaller than 1000 and larger than 1.
The random list must contain every number from 0 to (n - 1). Eg: [0, 3, 2, 5, 1, 4] (where n is 6).
Note: If there is more than one digit yo... |
Challenge
You have one string of input bytes, output only the last byte in it.
Rules
Your submission may be a program or function outputting the last byte in the input which
is either a string, stdin or command-line arguments, and
is non-empty.
I was trying to solve this with brainfuck, however all languages are allo... |
Shortest program wins, of course.
|
Your task here will be to write a very dumb AI capable of fetching all treasures on a map.
Map
The map is defined as follow: (artist-mode™-powered)
Basic case:
+-+-+-+-+-+-+-+-+-+-+-+-+-+
|P| | | | | | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | | | | | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | |T| | | | | | | ... |
If I need to get the number of diagonal squares in all directions:
I do the following formula 2 N − 2 − |x − y| − |x + y − N − 1|
The above example has 13 and that's what the formula gives.
Now, what if you wanted to get the diagonal squares, but only in one direction?
The top right has 4 squares, the top left has 3, ... |
Write a program that takes a single line string that you can assume will only contain the characters /\_‾. (That's forward and backward slash, underline and overline. You can use ~ in place of overline if you need since overline is not convenient ASCII.)
For example, one possible input is:
__/‾‾\/\_/‾
Your program nee... |
Inspired by this game
Challenge:
Given an ASCII art string representing a number, output that number.
Example:
Input:
&&&& ##### .====.. .&&&
$$$$$. %% %% % % . +. .
@@@ . @@ . = . = . ????
+++. && &&. % % = =
$$$ . @@@@@ # # . ===.
.$$$$$ ... |
In Pascal's triangle each number is the sum of the two numbers directly above it, treating empty spots as zero:
By rotating the triangle, we can cut out square matrices of varying sizes and rotations which I will call Pascal's matrices. Note that those matrices always need to contain the top \$1\$. Here are some examp... |
Write a program that inputs the dimensions of a painting, the matting width, and the frame width for a framed portrait. The program should output a diagram using the symbol X for the painting, + for the matting, and # for the framing. The symbols must be space-separated. Trailing whitespace is alright, as long as the o... |
You will be given an ASCII text. This text may have zero, one or many appearances of a split a character (let's assume it will be the space character )
You will also be given an offset integer value (zero based) anywhere between zero and the length of the text.
You should calculate the relative offset inside the one sp... |
Introduction (may be ignored)
Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all positive numbers. This is the second challenge in this series. The first challenge can be found here.
In this challenge,... |
This is what we'll call a bowl of alphabet soup - a roughly circular ascii-art shape with the 26 uppercase English letters (A-Z) arranged clockwise to form the perimeter:
XYZABC
VW DE
U F
T G
S H
RQ JI
PONMLK
Write a program that takes in a single letter character, A-Z, and... |
Hehe, see what I did with the title? Anyways...
Your job is to create a sudoku solver that accepts input in Morse code and creates output in Morse code. Here's the Morse code numbers for reference:
0: -----
1: .----
2: ..---
3: ...--
4: ....-
5: .....
6: -....
7: --...
8: ---..
9: ----.
Rules:
The code must... |
Challenge:
Input: A positive integer \$n\$
Output:
Create a list in the range \$[1,n]\$, and join it together to a string (i.e. \$n=13\$ would be the string 12345678910111213).
Now we output a triangle using the prefixes or suffixes of this string, in one of the following four orientations based on the input integer:
... |
Multiplicative Persistence
Multiply all the digits in a number
Repeat until you have a single digit left
As explained by Numberphile:
Numberphile "What's special about 277777788888899?"
Numberphile "Multiplicative Persistence (extra footage)"
Example
277777788888899 → 2x7x7x7x7x7x7x8x8x8x8x8x8x9x9 = 4996238671872
... |
There's a visual method for multiplication that is taught to Japanese schoolchildren [citation needed] that uses lines and crossings to get the answer.
Image Source
Your task is to implement this in ASCII art. You will be given two numbers to multiply. The output should be the corresponding ASCII art made up of \, /, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.