instruction stringlengths 34 53.1k |
|---|
You have to write an interpreter for a cool language called Chicken!
You should read a Chicken program from a file, standard input, program or function arguments, or whatever is most convenient for your language, as well as input to the program.
You should print or return the result of interpreting the program accordi... |
Update: There are 6 mazes. They are included in the controller. There is a tar.gz of the mazes and their .bmp files here (dropbox). There is also a utility for making more mazes at that link (the maze_4.txt file is incorrect in archive). At this point, please feel free to run your own entry and update your score. Detai... |
Basing on this SO question.
Challenge is rather simple: given a date period in the format YYYYMM output it in the format MMMYY.
Rules:
The input will be a number or a string exactly 6 characters long, consisting only of digits.
Last two digits will be between 01 and 12.
Output must be in the form MMMYY, where MMM repr... |
You've got a set of tiles with the symbols from the periodic table. Each symbol appears once. You're thinking up words to make but you want to know if it's possible or not.
The Challenge
Write a program in your favourite language that will take in a string as an input parameter. You may assume that input is not null, h... |
GOAL :
To Implement a character counting program
This is how this counting system works :
input of the program is a set of printable ASCII characters . the program counts each type of character , and outputs the number of each character , starting from first mentioned character to last mentioned character .
Example :... |
Task
Given a UTF-8 string (by any means) answer (by any means) an equivalent list where every element is the number of bytes used to encode the corresponding input character.
Examples
! → 1
Ciao → 1 1 1 1
tʃaʊ → 1 2 1 2
Adám → 1 1 2 1
ĉaŭ → 2 1 2 (single characters)
ĉaŭ → 1 2 1 1 2 (uses combining overlays)
チャオ → 3 3... |
Palindromic dates are dates that appear as palindromes: the string of digits can be read the same way backwards as forwards. For the North American date format (MM/DD/YYYY), the next few palindromic dates are:
02/02/2020
12/02/2021
03/02/2030
The Challenge
Create a function that returns all palindromic dates in a consi... |
Index sum and strip my matrix
Given a matrix/2d array in your preferable language
Input:
The matrix will always have an odd length
The matrix will always be perfectly square
The matrix values can be any integer in your language (positive or negative)
Example:
1 2 3 4 5 6 7
2 3 4 5 6 7 8
3 4 50 6 7 8 ... |
As the title -- although discretely -- hints, I only pay with dollars.
The challenge
Write a function/program that takes a string as input, which is a monetary value preceded by a symbol. ex) £4.99. Then, return that same amount converted to USD.
Input
You will get a string as input. It will have the currency symbol f... |
Introduction
A while back I stumbled across the tiny encryption algorithm (TEA) and since then I have recommended it whenever special cryptographic security properties were un-needed and a self-implementation was a requirement.
Now today, we want to take the name *tiny* encryption algorithm literally and your task will... |
Over at our friends at Puzzling.SE, the following puzzle was posted: Is this chromatic puzzle always solvable? by Edgar G. You can play it here.
Puzzle explanation
Given a m x n grid with tiles of three different colours, you may select any two adjacent tiles, if their colours are different. These two tiles are then co... |
Input
You are given a 2D map with balls and ground in it.
It looks like this:
1 5 2
3
4
__________________________
Each number is a ball, and the _ is ground level. The underscore _ character is not allowed in any other line than ground level line. There are only spaces, newl... |
Challenge description
Let's call a two-dimentional, rectangular array (meaning its every subarray has the same length), a grid. Every unit of a grid is either an empty space or a border. In a grid of characters, empty space is represented by a single whitespace; any other character is treated as a border. Sample grids ... |
There have been some tax rate calculator problems here that depend on defined rates (specifically US federal rates), but none that have done it for arbitrary lists.
Your task is to build a program or function that will take an arbitrary list of marginal tax brackets and calculate the effective amount of tax paid on a g... |
Given a positive integer n, simplify the square root √n into the form a√b by extracting all square factors. The outputted a,b should be positive integers with n = a^2 * b with b as small as possible.
You may output a and b in either order in any reasonable format. You may not omit outputs of 1 as implicit.
The outputs... |
Ninja Assassins - which ninja stays alive
some basic information
given an int N as the number of ninjas, return the number of the winning ninja.
At the end only 1 ninja survives,the question is which one? what was his number?.
Each ninja kills the ninja who stands after him. Afterwards, he passes the sword to the firs... |
Challenge
Write a program or function that given a string, returns a valid Brainfuck program that when compiled and executed as Brainfuck, returns that string..
Assume all inputs are encoded as ASCII.
Assume the outputted BF program will execute in an environment with an infinite tape.
Assume the pointer starts at c... |
In the game Stratego, the main game mechanic is when you attack an opponent's piece with yours. In this challenge, you job is to simulate one of these battles and say who survives.
Specs
You will get as input a pair of string representing Stratego pieces. The pieces are one of "S 1 2 3 4 5 6 7 8 9 10 B" (S is the Spy, ... |
Introduction
We -- especially the geeks among us, who tend to be fans -- all remember this old Far Side cartoon:
Clearly, Professor Schwartzman could have brushed up on his programming skills just a wee bit more before he put his invention to use. But can you replicate it yourself... using as few bytes as possible?
In... |
Graham's number \$G\$ is defined in this way:
\begin{align*}
u(3,n,1) & = 3^n \\
u(3,1,m) & = 3 \\
u(3,n,m) & = u(3,u(3,n-1,m),m-1)
\end{align*}
Then,
\begin{align*}
g_1 & = u(3,3,4) \\
g_2 & = u(3,3,g_1) \\
g_3 & = u(3,3,g_2) \\
& \vdots \\
G & = u(3,3,g_{63})
\end{align*}
You are given that \$u(3,3,2)=7625597484987\$... |
The esoteric programming language evil has an interesting operation on byte values which it calls "weaving". It is essentially a permutation of the eight bits of the byte (it doesn't matter which end we start counting from, as the pattern is symmetric):
Bit 0 is moved to bit 2
Bit 1 is moved to bit 0
Bit 2 is moved to... |
In scientific computing, it is often desirable to decompose some large domain into smaller "subdomains", then parallelize the computation by performing the work on each subdomain in parallel and the interaction of a subdomain with its neighboring subdomains. Since these interactions are typically data sync points, mini... |
Everybody loves nested lists! However, sometimes it's hard to make a nested list. You have to decide if you want to nest it deeper, or if you need to nest it shallower. So for your challenge, you must "Autonest" a list. To autonest a list, compare every pair of items in the list.
If the second item is smaller, separat... |
Fred is a quasi-friendly guy, but in reality he is mean.
Because of this, Fred lives alone in a small apartment in Los Altos, CA. Fred is so mean because he is very particular about water. He, therefore, needs your help with figuring out what his water bill is.
Your job is to write a function or program that returns h... |
Introduction
Aron Nimzowitsch was a leading chess master and a influential chess writer.
In his book 'My System', the first chapter deals about the importance of the center and why you should dominate it. The simple reason is that your pieces have more possible direct next moves when being in the center which again giv... |
We already have challenges to check if a string of brackets is fully matched and to count the number of balanced strings. It remains for us to generate these strings, but it will not be so easy…
A Dyck word is a string, of length 2n, consisting of n opening and n closing parentheses (( and )) fully matched (that is to ... |
Your task is to create a program will transform each letter of a text typed on a AZERTY keyboard to the equivalent on a QWERTY keyboard, using the same keystrokes.
Example: Hello; Zorld1 => Hello, World!
List of character to convert:
A <=> Q
Z <=> W
, => m
? => M
M => :
1 => !
9 => (
; => ,
§ => ?
0 => )
) => -
ù => '... |
You probably know Conway's Game of Life, the famous cellular automaton invented by mathematician John Conway. Life is a set of rules that, together, allow you to simulate a two-dimensional board of cells. The rules decide which cells on the board live and which ones die. With some imagination, you could say that Life ... |
Note: the first half of this challenge comes from Martin Ender's previous challenge, Visualize Bit Weaving.
The esoteric programming language evil has an interesting operation on byte values which it calls "weaving".
It is essentially a permutation of the eight bits of the byte (it doesn't matter which end we start cou... |
When doing weightlifting, I want to make a specific weight by attaching several plates to a bar.
I have the following plates:
6 plates of 1 kg each
6 plates of 2.5 kg each
6 plates of 5 kg each
6 plates of 10 kg each
The bar itself weighs 10 kg.
It's only allowed to attach the plates in pairs - they are attached at e... |
This challenge is a simple ascii-art one. Given two inputs, describing the height and width of a Lego piece, you have print an ASCII art representation of it.
Here is how the Lego pieces are supposed to look:
(4, 2)
___________
| o o o o |
| o o o o |
-----------
(8, 2)
___________________
| o o o o o o o o |
| o o ... |
Given 3 bytes or RGB as input, calculate the nearest CMYK values, and output them.
create either a function with parameters and return value or a program that operates on stdin/stdout
use the color profile of your choice, but provide a reference
input may be either separate numeric values in range [0;255] or a 6 digit... |
In the classic days of Starbucks before these newfangled sticker-printers and wireless drivethrough headset palmtop scanner dealies, in the heady days of 2000-ish, Starbucks had a concise system for describing beverages with a strict syntax and accompanying encoded form.
Vertically on the cup there are a series of labe... |
Input:
An integer
Output:
Sum of the input itself + the length of the input + each individual digit of the input.
nr + nr-length + {sum of digits} = output
Examples:
Input: 99
Output: 99 (nr) + 2 (nr-length) + (9 + 9) (digits) → 119
Input: 123
Output: 123 + 3 + (1 + 2 + 3) → 132
Challenge rules:
The input can also co... |
In the arcade version of the game, Pac-Man eats pac-dots. However, in this challenge, he's hungry for alphanumeric characters and punctuation in a string.
Your task is to create a function that feeds Pac-Man a string, evaluates if he can eat it or not, and returns the string with Pac-Man's location in it.
Pac-Man (<) e... |
Introduction
Your mission in life is simple: Prove people wrong on the internet!
To do this you usually carefully analyze their statements and point out the contradiction in them.
It's time to automate this, but as we are lazy, we want to prove people wrong with the least effort (read: shortest code) possible.
Specific... |
Challenge description
Let's take a positive integer n, reverse its digits to get rev(n) and get the absolute value of the difference of these two numbers: |n - rev(n)| (or abs(n - rev(n))).
Example:
n = 5067
rev(n) = 7605
|n - rev(n)| = |5067 - 7605| = |-2538| = 2538
After repeating this operation sufficiently many t... |
I was browsing esolangs, and chanced upon this language: https://github.com/catseye/Quylthulg.
One interesting thing about this language, is that it doesn't use prefix, postfix, or infix, it uses all three of them, calling it "panfix" notation.
Here is an example. To represent normal infix 1+2 in panfix, it becomes: +1... |
Your challenge is simple: GIven an integer N, ouput every list of positive integers that sums to N. For example, if the input was 5, you should output
[1, 1, 1, 1, 1]
[1, 1, 1, 2]
[1, 1, 3]
[1, 2, 2]
[1, 4]
[2, 3]
[5]
These lists do not have to be output in any particular order, nor do the numbers inside each list. Fo... |
Your task is "simple" should you choose to accept it.
Write an HQ9+ compiler in a language of your choice.
HQ9+ has four commands (as you may be able to tell) H prints "Hello, World!" Q prints out the source code (this can either be the compiled source or HQ9+ source for the purpose of this challenge),9 prints out the... |
There is a parade marching through a city! There are 3 main groups of marchers: the (B)and, Poster (C)arriers, and (F)lag Holders. Also, every (P)oliceman in the whole city is on duty.
Flag holders (F) can march anywhere in the parade, but two flag holders cannot march next to each other, unless three or more flag hold... |
Given the coordinates of several points on a plane, and the radius of a circle surrounding each point, draw polygons representing the circles and the edges where the circles meet. Straight edges will always fall along circle-circle intersection lines, but might not follow the full length of these lines.
Per mbomb007's ... |
Based on this question from Code Review
Given a non-empty string of printable ASCII characters, output the second non-repeating character. For example, for input DEFD, output F.
Input
A single string, in any suitable format.
Output
The second character that doesn't repeat, when reading left-to-right, again in a suit... |
You should a program in language X, which will only output its source code (i.e function as a quine) when it is not a monday. On monday it should output some string with a levehnstein distance of 4 from the source code. i.e if the code is aaaa on sunday it should output aaaa and on monday it could output ....aaaa or bb... |
Input: Two integers. Preferably decimal integers, but other forms of numbers can be used. These can be given to the code in standard input, as arguments to the program or function, or as a list.
Output: Their sum. Use the same format for output integers as input integers. For example, the input 5 16 would lead to the o... |
Let's parse and process Key-Language! Given the input of a sequence of keyboard keypresses and/or special keys, write a program, function, etc. that outputs the product when all the actions are processed based on the following keyboard:
+-------------------------------------------------------+
| ~ | ! | @ | # | $ | % |... |
The C preprocessor is not turing-complete, but you can do some pretty cool stuff with it.
The challenge is to make an integer adder with it. You can use any representation you like: base 2, base 10, unary, separate each digit with a comma, etc. Whatever you do, you may only use the C preprocessor.
The rules are simple:... |
Given a list of integers, create a boolean mask such that the true indices can be used to filter the distinct values from the list. Which index is selected as the true one does not matter as long as only one of them is selected for each set of indices corresponding to identical values.
The input will be a non-empty lis... |
A bag, also called a multiset, is an unordered collection. You can call it a set that allows duplicates, or a list (or an array) that is not ordered/indexed. In this challenge, you are asked to implement bag operations: addition, difference, multiplication, division, counting and equality test.
Operations
The specified... |
There are numerous reasons for trying to obfuscate input. These include preventing decompiling, and being a nuiscance.
With this in mind your challenge should your choose to accept it is to write a meta-obfuscator. Your code must in some Language X receive input as a String, and output a program in language X that out... |
THE TASK
DEFINITIONS
Consider the points {1,2,3,4,5} and all their permutations. We can find the total number of possible permutations of these 5 points by a simple trick: Imaging filling 5 slots with these points, the first slot will have 5 possible numbers, the second 4 (as one has been used to fill the first slot) t... |
Inspiration.
Task
Reverse runs of odd numbers in a given list of 2 to 215 non-negative integers.
Examples
0 1 → 0 1
1 3 → 3 1
1 2 3 → 1 2 3
1 3 2 → 3 1 2
10 7 9 6 8 9 → 10 9 7 6 8 9
23 12 32 23 25 27 → 23 12 32 27 25 23
123 123 345 0 1 9 → 345 123 123 0 9 1
|
Write some code to do the following:
Take as its input a signed integer in either signed decimal or signed octal
(explained below)
If the number is decimal convert it to octal. If it's octal, convert it to decimal
Output the number!
Instead of starting with a 0, negative octal numbers will start with a Z (capital zed... |
Task
Find a sequence of all numbers between min and max where every number differs from every other number in the sequence by at least "d" digits.
Example of sub-sequence
For min = 0, max = 1000 and d = 2, the following is part of one possible solution sequence:
123 ← Good
132 ← Good
145 ← Good
146 ← Bad
Notes
This i... |
On TeX.SE the Help Centre says that the following is on topic:
Formats like LaTeX, ConTeXt and plain TeX
Engines like pdfTeX, LuaTeX and XeTeX
Distributions like TeX Live, MiKTeX, and MacTeX
Related software and tools, BibTeX, MakeIndex, Lyx, etc.
I wanted you to write a program to tell me whether my TeX is in the on-... |
This is a mirror: |. I just found out that you can stick a mirror in the middle of a string if the string can be mirrored on itself! For example, the string abccba. If you cut it in half the two halves are mirror images of each other:
abc <--> cba
So, we can stick a mirror in the middle of the string, and our new st... |
Consider the following definitions taken from The number of runs in a string by W. Rytter. Note that word, string and substring are all roughly synonyms.
A run in a string is a nonextendable (with the same minimal period)
periodic segment in a string.
A period p of a word w is any positive integer p such that w[i... |
Challenge description
Given a list / array of items, display all groups of consecutive repeating items.
Input / output description
Your input is a list / array of items (you can assume all of them are of the same type). You don't need to support every type your language has, but is has to support at least one (preferab... |
Input: n
Output: A list of length n, with each element being the nth happy prime.
Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number either equals 1, or it loops endlessly in a cycle which does not include 1. A happy number is a number... |
There are already 30 challenges dedicated to pi but not a single one asks you to find the nth decimal, so...
Challenge
For any integer in the range of 0 <= n <= 10000 display the nth decimal of pi.
Rules
Decimals are every number after 3.
Your program may be a function, or a full program
You must output the result in ... |
Domain name trading is big business. One of the most useful tools for domain name trading is an automatic appraisal tool, so that you can easily estimate how much a given domain is worth. Unfortunately, many automatic appraisal services require a membership/subscription to use. In this challenge, you will write a si... |
July 1st is Canada day (yay Canada)! Or is it? It seems that the Wikipedia page for this day has a lot of Canada related content, but is there another day which is more Canadian?
Your task is to write a program or function which takes a date (month and day) as input and returns or outputs the number of mentions of "Ca... |
Introduction and Credit
Today without a fancy prelude: Please implement takewhile.
A variation of this (on a non-trivial data structure) was an assignment at my university functional programming course. This assignment is now closed and has been discussed in class and I have my professor's permission to post it here (I... |
Task:
Make a program that leaves a comment on this question. The content should be 1234567890123456.
Edits:
You may leave your usernames and passwords as U and P if you are
using username and password. (if applicable)
No URL Shorteners (if applicable)
You may not use the browser console.
|
Background
Countless generations of children have wondered where they would end up if they dug a hole directly downwards. It turns out that this would, unsurprisingly, be rather dangerous, but anyway...
Antipodes are points that are directly opposite each other on the Earth's surface. This means that if a line was draw... |
[This question is a follow up to Compute the runs of a string ]
A period p of a string w is any positive integer p such that w[i]=w[i+p]
whenever both sides of this equation are defined. Let per(w) denote
the size of the smallest period of w . We say that a string w is
periodic iff per(w) <= |w|/2.
So informa... |
The goal here is to simply reverse a string, with one twist:
Keep the capitalization in the same places.
Example Input 1: Hello, Midnightas
Example Output 1: SathginDim ,olleh
Example Input 2: .Q
Exmaple Output 2: q.
Rules:
Output to STDOUT, input from STDIN
The winner will be picked 13th of July on GMT+3 12:00 (One... |
Your task is to, with an input number p, find the smallest positive cannonball number of order p that is NOT 1.
Definition
A cannonball number (of order p) is a number which is both:
An p-gonal number (See this page).
and an p-gonal pyramid number.
The nth p-gonal pyramid number is the sum of the 1st to nth p-gonal n... |
Consider the following table for the function d(n), which calculates the number of factors that n is divisible by without a remainder:
n | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ...
d(n) | 1 | 2 | 2 | 3 | 2 | 4 | 2 | 4 | 3 | 4 | 2 | 6 | ...
Going from left to right, it is possible to determine the "c... |
A set is sum-free if no two (not necessarily distinct) elements when added together are part of the set itself.
For example, {1, 5, 7} is sum-free, because all members are odd, and two odd numbers when added together are always even. On the other hand, {2, 4, 9, 13} is not sum-free, as either 2 + 2 = 4 or 4 + 9 = 13 ad... |
Are you tired of languages with built in quining techniques?
Your challenge, should you choose to accept it, is to add a built-in quine feature to the language of your choice.
Task
Given some programming language X, you should define
A language X′ that is a subset of X.
A quine command string Q. (This is a string of ... |
An uninteresting number (which I totally didn't make up only for this challenge) is created like this:
Take a positive integer N
Create a new number O by adding the digits of N at the end of N
The final uninteresting number is O*N
For example for N=12:
O = 1212
O*N = 1212 * 12
Final number is 14544
Input
A posi... |
If an integer has a digit/sequence of digits in it which repeats continuously (You will understand why I said "continuously") 5 or more times, we call It "Boring".
For example, 11111 is Boring, whereas 12345 is not.
Instructions
Take an Integer as Input
Output a truthy value if the integer is boring, and a falsey value... |
Given n (the number of players), t (the threshold value), and s (the secret), output the n secrets generated by Shamir's Secret Sharing algorithm.
The Algorithm
For the purposes of this challenge, the computations will be done in GF(251) (the finite field of size 251, otherwise known as the integers mod 251). Ordinaril... |
Given a non-negative integer (n), create a function that returns n in alphabetical order, according to the literal spelling of each digit in n.
Examples:
Input: 101
>> one, zero, one
>> one, one, zero
Output: 110
Input: 31948
>> three, one, nine, four, eight
>> eight, four, nine, one, three
Output: 84913
Input: 5544
... |
Given a string, return that string's "luck".
A string's luck, as I completely just made up for the purpose of this challenge, is an integer, determined as so:
The base luck for a string is 1.
For each consecutive letter it shares with the word "lucky" (case insensitive), multiply the luck by 2. For instance, if your s... |
A dual graph is defined such that for every "face" in a graph G, there is a corresponding vertex in the dual graph, and for every edge on the graph G, there is an edge in the dual graph connecting the vertices corresponding to the two faces on either side of the edge of the original graph. Note that the faces on both s... |
Inspired by this, print an ascii diamond pattern built using 0-9.
Rules
Input n should be between 0-9, anything outside that range is undefined
The diamond should be padded with spaces
The middle line should always have no padding and be the only line to contain n, in the center
Print to stdout
As always, this is code... |
Stackylogic is a logic-based programming language I made up that take in 0's and 1's for input and outputs a single 0 or 1 upon completion.
A Stackylogic program consists of lines that can only contain the three characters 01? as well as exactly one < at the end of one of the lines. Lines may not be empty and the line ... |
Do you recognize the PPCG logo?
it looks like this, when you do an ascii art of it.
+---+
|PCG|
+---+
v
Now, In this Code Golf, You will make a code, that makes logos for other sites, similar to the PPCG logo.
What You should do
The "Shortened" string will be the string, with all upper case letters and numbers in t... |
Create a program that determines, given an input of the path, whether Mario can reach the end, denoted by E, from the start, denoted by S.
A path will look something like this:
S = E
=====
In a path, the various symbols and what they represent are:
=: wall/floor/ceiling. Mario cannot walk through wall , and cannot fa... |
Write a program or function which, given an input string and a standard deviation σ, outputs that string along the normal distribution curve with mean 0 and standard deviation σ.
Normal distribution curve
The y coordinate of each character c is:
where σ is given as input, and where x is the x axis coordinate of c.
Th... |
The challenge
Given an input string, and an integer n - truncate any runs of consecutive characters to a maximum of n length. The characters can be anything, including special characters. The function should be case sensitive, and n can range from 0 to infinity.
Example inputs/outputs:
f("aaaaaaabbbccCCCcc", 2) //"aabb... |
Introduction
Kipple is a stack-based, esoteric programming language invented by Rune Berg in March 2003.
Kipple has 27 stacks, 4 operators, and a control structure.
Stacks
The stacks are named a-z and contain 32-bit signed integers. There is also a special stack, @, to make outputting numbers more convenient. When a nu... |
Chameleon challenges are a bad thing, apparently. Too bad, chameleons are beautiful creatures. Time for a change!
As we all know, many chameleons posses a remarkable ability to blend in with their surroundings by changing the color of their skin. Which is also the objective of this challenge.
Challenge
Imagine a squar... |
The goal is, having taken a string as input, duplicate each latin letter and "toggle" its case (i.e. uppercase becomes lowercase and vice-versa).
Example inputs & outputs:
Input Output
bad bBaAdD
Nice NniIcCeE
T e S t Tt eE Ss tT
s E t sS Ee tT
1!1!1st! 1!1!1sStT!
n00b nN00bB
(e.g... |
Convert a classical directory structure like this:
config.yml
drafts
begin-with-the-crazy-ideas.textile
on-simplicity-in-technology.markdown
includes
footer.html
header.html
Into this
.
├── config.yml
├── drafts
| ├── begin-with-the-crazy-ideas.textile
| └── on-simplicity-in-technology.markdown
└──... |
Everybody loves golfing code. Code is written in English (eh...). Therefore, everybody loves golfing English!
Your task is to write a program or function that takes a string as input, and then returns or prints the golfed version. There will be no newlines or tabs in the input.
This is how you golf a string. The order... |
Introduction
This site is rapidly building up a huge dataset of code snippets, so let's do something with it!
Here's a data file. It contains 9,066 unique language+snippet pairs for 113 languages, all taken from this site. The format is tab-separated (language-TAB-snippet), with all newlines in the snippets replaced wi... |
Inspired by this challenge
Given a number m, output a program that prints out the string Do not repeat yourself.
Now for the challenging part: Each program the original code prints out has to have the byte at place m*n be the same as m*n + 1 and the same as m*n + 2 .... all the way down to m*n + m - 1.
(In case you can... |
Your program's input is a string containing whitespaces, parentheses, and other characters. The string is assumed to be parenthesed correctly, i.e. each right parenthesis matches a unique left parenthesis and vice versa : so the program is allowed to do anything on incorrectly parenthesed strings, such as )abc, (abc or... |
Your goal in this code golf is to take two strings, language and code (if the golfed code you wrote for this is multiline, then this variable would be multiline.), and one integer, bytes. They represent the variables for a programming language, number of bytes it takes, and the code itself.
After that, you are going to... |
i.e each byte appears in a different ANSI shell colour.
Rules
Resetting the color of the shell after output is not required
Must be output in STDOUT or the primary colour text output of your language.
Must be done programmatically (iterating through each color and letter of the string induvidually) instead of just wri... |
You know—they look like this:
source
The goal is to draw a music beats illustration like the following:
= = =
= = = = =
== = == = == = ====
== ==== == === = = =======
======== == ==== = ========= =
=================================
The rules are:
The width of the illustration is 3... |
A heap, also known as a priority-queue, is an abstract data type. Conceptually, it's a binary tree where the children of every node are smaller than or equal to the node itself. (Assuming it's a max-heap.) When an element is pushed or popped, the heap rearranges itself so the the biggest element is the next to be poppe... |
Output the current time of day as Swatch Internet Time.
Specifically, output a three-digit (zero-padded) number of ".beats" (1000ths of a day) which represent the current time of day in the Swatch Internet Time time zone of UTC+01:00 ("Biel Meantime").
For example, if the current time in UTC is 23:47, then it is 00:47 ... |
Challenge: Print the entire printable ASCII charset (not just a range!) in order.
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
Rules: read closely
No other characters allowed in the output.
Program/function does not accept input.
Try not to hardcode/embed the outpu... |
Tom is going to implement a new programming language of his invention. But before actually starting working on it, he wants to know whether his language should be case sensitive or not.
On one hand, case insensitivity seems more easy to implement to him, but he worries that it could cause a lack in the possibilities o... |
This year's UEFA Euro 2016 is over and besides a couple of negative headlines there has been a very positive surprise as well – the Iceland national football team. Let's draw their national flag.
Input
Well, obviously this challenge has no input.
Output
Draw the flag of Iceland in any applicable visual format of at le... |
Generate the nth Narayana-Zidek-Capell number given an input n. Fewest bytes win.
f(1)=1, f(n) is the sum of the previous floor(n/2) Narayana-Zidek-Capell terms.
Test Cases:
f(1)=1
f(9)=42
f(14)=1308
f(15)=2605
f(23)=664299
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.