instruction stringlengths 34 53.1k |
|---|
The Challenge
Given a rational number, determine the smallest number which is a positive integer multiple of it. Eg.
Given: 1.25
x1: 1.25
x2: 2.5
x3: 3.75
x4: 5
Thus: Answer is 5
Clarifications
Inputs will be a rational number in the range of (0,100] of which the Decimal Representation has no more than 4 ... |
Related.
Given a number \$n\$, Euler's totient function, \$\varphi(n)\$ is the number of integers up to \$n\$ which are coprime to \$n\$. That is, no number bigger than \$1\$ divides both of them.
For example, \$\varphi(6) = 2\$, because the only relevant numbers are \$1, 5\$. This is OEIS A000010.
We can now define th... |
Since programming is predicted to become natural linguisized by the unstoppable advances in LLM technology, perhaps we can code golf LLMs themselves.
Produce the shortest question that is not an arithmetic problem (we know it sucks at multiplication problems) that produces an obvious falsehood from ChatGPT with screens... |
Input
A binary string \$s\$ of length \$n\$ and a positive integer \$k \leq n\$.
Output
The number of binary strings with Levenshtein distance exactly \$k\$ from the string \$s\$.
Example outputs
Each example gives the largest possible output for the given \$(n, k)\$ pair.
k=1, s=1010, output=14
k=2, s=1010, outupt=55... |
What is the shortest regular expression (REGEX) you can create for file extensions for all of the following image file formats (photographs, paintings, sketches, and drawings)?
.ACAD
.AFD
.AFP
.AOM
.AOMA
.APNG
.ASCII
.AVIF
.AVIFAV
.BMP
.BPG
.CABAC
.CDEC
.CDR
.CDRAW
.CGM
.CHEVC
.CIEC
.CIPA
.CMYK
.COLLADA
.CRT
.CWC
.DEEP... |
Playing the game of memory against a machine is highly unfair, because they play almost as good as small children. So let's make the machine play alone, but in a fair way:
Input: 1...26 pairs of lowercase letters in random order like zz or gttg or abcdefghiabcdefghi. You can trust each letter appears exactly twice and... |
Write a program or function that outputs all positive integers with distinct decimal digits (OEIS: A010784)
Examples:
1 2 3 4 5 6 7 8 9 10 12 13 ...
96 97 98 102 103 ...
123456789 123456798 ... 9876543120 9876543201 9876543210
Rules
You can output the list of numbers in any convenient format (string with separators, ... |
Objective
You're on a nonempty list of integers that wraps around. You start at the leftmost entry of the list, and keep jumping to the right to the amount of the integer entry you're at.
Eventually, you'll end up in a cycle. The objective is to output the length of this cycle.
I/O format
Provided that the inputted lis... |
Goal: create a self-referencing tuple satisfying x == (x,) in any version of Python. Standard libraries, matplotlib, numpy, pandas only.
Answers meeting this extra condition are prioritised (which may be impossible): this tuple should also be insertable into a dict or set.
If the extra condition is impossible, apart fr... |
OEIS A090461 details the ‘numbers k for which there exists a permutation of the numbers 1 to k such that the sum of adjacent numbers is a square’. This has also been the subject of Matt Parker’s Numberphile and Alex Bellos’ Monday puzzle.
This code-golf challenge is related to the square sum problem above and asks you ... |
Need to write a JS function compare(a,b) for numbers which return
1 when a > b, 0 when a == b, -1 when a < b.
Also following properties should hold:
compare(NaN, NaN) = 0
NaN is bigger than any other number, so compare(NaN, any) = 1 and compare(any, NaN) = -1.
compare(-0.0, 0.0) = -1 and compare(0.0, -0.0) = 1.
Other ... |
Inspired by this (off topic) post
Given an array of numbers, find the largest sum over a subarray not containing two adjacent elements
[1,2,3,4] -> 6 // [_,2,_,4]
[1,2,3,4,5] -> 9 // [1,_,3,_,5]
[2,2,1,1,2,1,1,2] -> 7 // [2,_,1,_,2,_,_,2]
[3,1,4,1,5,9,2] -> 16 // [3,_,4,_,_,9,_]
[9,8,7,9,9,8] ... |
Subleq is a Turing-complete esolang with only one instruction, SUBLEQ. This instruction takes in three parameters, A, B, and C, all of which are memory addresses. The instruction subtracts the value in memory address A from that in memory address B, storing it in address B. If the value at B is now less than or equal t... |
Given an array of letters in the range 'a' to 'o', compute how to construct the array by successively inserting the letters in alphabetical order. You will always start the insertion with a base array of all the 'o's that are in the array to be reconstructed.
Examples
Let the input array be:
['o', 'b', 'o', 'b', 'a']
... |
Background
Numeric Mahjong is a hypothetical variation of Japanese Mahjong, played with nonnegative integers instead of Mahjong tiles. Given a list of nonnegative integers, it is a winning hand if it satisfies the following:
its length is \$3n+2\$ for some nonnegative integer \$n\$, and
it can be partitioned into \$n\... |
Just because the reverse and palindrome were not too challenging individually :)
Write a program (full program or function) that satisfies the following: given a string input,
the program as-is outputs the input string unchanged.
the program reversed outputs the input string reversed.
the program palindromized outputs... |
Some built-in functions in PHP return mixed types, like file_get_contents that returns both string or false. Union structs in C can be used to simulate this, but is there a way to make it polyglot, that is, can be run in both PHP and C without (major) modification? Macros is often one way.
$result === false
can be rep... |
The task is to calculate the average "funniness" of a given number given the following scoring system:
1 point for each "420" in it
2 points for each "69" in it
3 points if its a palindrome (doesn't count if it's just a single digit)
4 points if it has (not for each) "800813"
5 points for ending in "420"
6 points for ... |
In this challenge, you'll take an answer as input, and print the answer before it. If the answer passed as input is the first answer, print your own submission's source. You'll be passed any answer in the chain up to and including your own answer, but none after it in the chain.
For example, if the first submission is ... |
Write a program that outputs its source code in reverse when run, and outputs its source forwards when I reverse the source. If your program is "abcd", when run with no arguments it should output "dcba", and when I run the program "dcba" it should output "abcd."
This is a quine challenge, so both your forwards and reve... |
Input: an array of length \$n\$ containing integers in the range \$0\$ to \$2n\$.
For each integer \$x\$ in the array, compute the number of integers that occur before \$x\$ that are no larger than \$x\$.
As an example, if the array is
[3, 0, 1, 4, 3, 6]
the output should be equivalent to:
3: 0
0: 0
1: 1
4: 3
3: 3
6: ... |
Barbrack
Your task is to write a program or function that takes a non-negative integer (in decimal or any other convenient base for your language), and output a number in the numbering system Barbrack.
What's that?
Barbrack is a numbering system I made up that can represent non-negative integers. Zero is represented wi... |
Background
From Wikipedia: An Egyptian fraction is the sum of distinct unit fractions. That is, each fraction in the expression has a numerator equal to 1 and a denominator that is a positive integer, and all the denominators differ from each other. The value of an expression of this type is a positive rational number ... |
The autokey cipher is closely related to the Vigenère cipher (both were invented by Blaise de Vigenère). Decryption involves the encrypted message and the key. For simplicity, let us assume all characters in the message and key are lowercase letters (no spaces, numbers or symbols etc.).
How to decrypt the cipher
Conve... |
Your challenge is to print any 100 consecutive digits of π. You must give the index at which that subsequence appears. The 3 is not included.
For example, you could print any of the following:
1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 (index 0)
821480865132823... |
Your task is to write a program \$p\$ which outputs a string \$s\$ with the same length as \$p\$, where \$s \neq p\$.
If I remove the \$n\$th byte from your program to get program \$q\$, then either \$q\$ outputs \$s\$ with the \$n\$th byte removed, or it does something else.
Your score is the number of ways a single b... |
The aim of this post is to gather all the tips that can often be applied to radiation-hardening challenges.
Please only post answers which can apply to a large number of languages, and one tip per answer.
|
In this challenge, we define a range similarly to Python's range function: A list of positive integers with equal differences between them. For example, [1, 2, 3] is a range from 1 to 3 with a skip count of 1, because there is a difference of 1 between each item, and [4, 7, 10, 13] is a range from 4 to 13 with a skip c... |
In this challenge, we define the complement of a list of positive integers as all positive integers not included in that list. For example, the complement of the even numbers [2, 4, 6, 8...] is the odd numbers [1, 3, 5, 7...]. Your challenge is to, given a monotonically increasing, infinite list of positive integers, ... |
Background
The look-and-say sequence begins with \$1\$, each following term is generated by looking at the previous and reading each group of the same digit (eg. \$111\$ is three ones, so \$111 \rightarrow 31\$). The first few terms are
$$ 1, 11, 21, 1211, 111221, 312211, \dots $$
Conway's cosmological theorem says tha... |
The JavaScript compressor RegPack uses a very simple string compression algorithm. Given a piece of code, it will make a list of characters that aren't used in that code and use them to delimit repeated strings that are inserted back into the string.
To show how strings are compressed, it's necessary to show how the de... |
This challenge is to list out all possible words which are built from a pattern of syllables. Words are composed by joining syllables together. Syllables are composed of a number of vowels with some number of consonants optionally to the left and/or right. Your code should take in:
a list of consonants
a list of vowel... |
In this challenge you will take a non-empty (finite) list of (possibly infinite) lists of positive integers, and your task is to output the longest one. An infinite list is longer than a finite list of any length, and any two infinite lists are equally long.
You're guaranteed that there won't be any ties for longest be... |
Transposition is an operation on 2-dimensional arrays that flips every element across the main diagonal:
[[1,2,3], [[1,4],
[4,5,6]] -> [2,5],
[3,6]]
If we call the above array m, then the 2 is the second item of the first row of m, or m[0][1]. The 2 can be thought of as having a coordinate of [0, 1]... |
Given a number \$n\$, you are to compute the sequence of positive numbers where for each number \$a\$, the \$n\$-times multiple \$n\cdot a\$ is missing.
Example
We always start with the sequence of all positive numbers: $$1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \dots$$
For \$n=2\$, going left-to-right, we first encounter ... |
An even distribution number is a number such that if you select any of it's digits at random the probability of it being any particular value (e.g. 0 or 6) is the same, \$\frac1{10}\$. A precise definition is given later on.
Here are a few examples:
\$\frac{137174210}{1111111111} =0.\overline{1234567890}\$ is an even... |
For each character in your program, the program with that character removed must produce a number smaller than the program with the next character removed. Your base program isn't required to do anything, and may be invalid.
An example submission could be abcd, where bcd outputs 1, acd outputs 4, abd outputs 5, and abc... |
Objective
Given a nonnegative integer, calculate its NDos-size as defined below, and output it.
NDos' numeral system
The concept of NDos-size comes from the numeral system I made. It represents every nonnegative integer by a nested list, as follows:
With the binary expansion of given nonnegative integer, each entry of... |
Here is a challenge:
What is the shortest possible compiled program? Writing one line programs are fun, but they often lean on language libraries that get pulled into the final bits. How lean can you get the 'scaffolding' that supports and hooks into the compiled instructions? This seems like an interesting question be... |
A problem I sometimes encounter is that when writing comments using LaTeX, the comment is too long. Today you will solve this, by writing code which, given a LaTeX math expression, will produce the shortest equivalent expression.
To define equivalent expressions, we will need to specify a (simplified) parser for LaTeX:... |
Input
The code should take an integer \$n\$ between 1 and 1000.
Output
The code should output positive integers with \$n\$ bits. Accompanying each integer should be its full factorization. Each integer should be a uniformly random \$n\$ bit number.
Score
The score for your code will be the number of integers it outputs... |
Challenge:
Given a positive number \$n\$, convert it to binary, and output a sequence where all 1s form a top-left to bottom-right diagonal line, including a leading column of 1s. To give two examples:
\$n=1\$ will result in [1,3,5,9,17,33,65,129,...], with binary values:
1
11
101
1001
10001
100001
1000001
10000001
↓ ... |
The divisors of a natural number form a poset under the relation of "a divides b?", \$a | b\$. This challenge is to produce the number, \$C\$, of non-empty chains of such posets for natural numbers, \$N\$.
This is A253249 in the Online Encyclopedia of Integer Sequences.
That may sound complicated, but it's not really, ... |
Not sure if it's correct to ask such a question on this site, but let's try.
Let a(n) be a sequence of positive integer such that a(1) = 1. To reproduce the sequence a(n) through itself, use the following rule: if binary 1xyz is a term then so are 110xyz and 1XYZ where the last one is the same as 1xyz with rewrite 1 ->... |
The Euclidean GCD Algorithm is an algorithm that efficiently computes the GCD of two positive integers, by repeatedly subtracting the smaller number from the larger number until they become equal. It can be visualised as such:
We start with a MxN grid, where M and N are the numbers. In this example I'll use M=12, N=5:
... |
In crossword terminology, the grid is the region into which the crossword answers are inserted, consisting of white and black squares. The crossword answers, called entries, are inserted into contiguous sequences of white squares in a row or column, separated by black squares.
For straight (American) crosswords, the g... |
This was originally a pure mathematics question, but I think I've got the best chance for an answer here.
The Challenge
For concreteness, consider Peano Arithmetic (PA). For some language L of your choosing, construct a computer program of length at most N bits in L such that:
If it terminates, it outputs a number th... |
You work at a beach. In the afternoon, the sun gets quite hot and beachgoers want to be shaded. So you put out umbrellas. When you put out umbrellas you want to shade the entire beach, with as few umbrellas as possible.
Umbrellas come in many sizes. However, larger umbrellas are susceptible to being pulled away by the ... |
Emmet is a text-editor and IDE plugin for writing HTML code using much fewer keypresses. You might think of it like a code-golfing HTML preprocessor. Its syntax is based on CSS selectors.
Your challenge is to code-golf an implementation of Emmet. Given some Emmet code, output the resulting HTML.
Note that for the purpo... |
This originally came from Give the best Chaitin incompleteness bound, but I realized that there was a fragment of this problem which still potentially gives a good coding challenge.
First Order Logic With Equality
First, I will need to fix an encoding of first order formulas ('For all x there exists y such that ...'). ... |
A fixed-point combinator is a higher order function \$\mathrm{fix}\$ that returns the fixed point of its argument function. If the function \$f\$ has one or more fixed points, then $$\mathrm{fix} f=f(\mathrm{fix} f).$$
The combinator \$Y\$ has such properties. Encoded in lambda calculus: $$Y=\lambda f.(\lambda x.f(x x)... |
The Universal Crossword has a set of guidelines for crossword puzzle submissions.
In this challenge we are going to be concerned with their rules for hidden word themes. A hidden word clue consists of a clue and a word. It can either be a
"word break" or a "bookend".
For a word break the word must not appear as a cont... |
Befunge is a 2-dimensional programming language, with an instruction pointer (IP).
In Befunge-98, the ; character tells the IP to skip characters up until the next ; (Let us call it skipping mode when the IP is skipping characters). Here is an example:
"This part is read into the stack" ; this part is not ; @
I would ... |
In the video game Minecraft, the player can obtain experience points (XP) from various activities. In the game, these are provided as XP "orbs" of various sizes, each of which give the player various amounts of XP. The possible orbs are shown in the image below, along with the smallest and largest amount of XP that orb... |
Task
Here is an interesting math problem:
Let's say that there are \$n\$ indistinguishable unlabeled objects in a bin. For every "round", pull \$k\$ objects randomly out of the bin with equal probability, and apply a label on each object (Nothing happens to objects already having a label). Then put these \$k\$ objects... |
I wrote a code that separates the numbers from 1 to 9999 by comma
void p(n){printf("%d,",n);if(n<9999){p(n+1);}}main(){p(1);}
Is there a way to make this short code without using a repeat statement?
|
In this challenge, you will play the iterated Prisoner's Dilemma, but with a twist: There's also an adversary trying to mess you up!
The Prisoner's dilemma is a scenario in game theory where there are two players, who we'll call the "prisoners", each with two options: cooperate, or defect. Each prisoner does better for... |
The Brits aren't exactly known for being good at memorizing stuff. That's why scientists need newspaper articles to find those who are, and that's why it shouldn't be a surprise that they forget more than a 1000 things per year, including phone numbers, addresses, birthdays and more. Now, it is your duty to help the Br... |
Party time! All of your guests are sitting around a round table, but they have very particular seating requirements. Let's write a program to organize them automatically!
Guests are represented by letters: Female guests are uppercase, males are lowercase. Couples have the same letter, one lower and one upper, like gG, ... |
We already have a challenge for polynomial interpolation: given a list of points, output the coefficients of the polynomial that passes through them.
Hermite interpolation is a generalization of polynomial interpolation. Instead of just specifying the points that the polynomial passes through, we also specify the highe... |
Introduction
Finding the closest power to a number is a common enough problem. But what if you need both the next-highest and next-lowest power? In this challenge you must find the closest powers to a given number - the 'power sandwich' if you will, where the given number is the filling and the powers are the bread. Mm... |
Introduction
This challenge was inspired by a seemingly simple task requested at work that couldn't easily be done in Microsoft Teams. At least not from what we could find!
Task
Your task, if you choose to accept it, is to output the last week day of any month in any year.
Input
You can input the desired month/year in ... |
I was seen multiple shortest "Hello World!" program, but this is the longest program.
The Rules
Each submission must be a full program.
This must be non-interpreted language (for example, JavaScript, Python, HTML, etc.)
Target OS must be Windows, Mac, Linux or MS-DOS.
The challenge
Writing a longest Hello World prog... |
We all know run-length decoding: A list of character-length pairs expands to a string of that many characters, so A1B4C2 expands to ABBBBCC. But what if we stretch this concept to 2 dimensions?
Instead of character-length pairs, in this challenge you will be given character-length-direction triples. For example, using ... |
What is the shortest selector (by character count) to select ALL html elements on a web page, without using asterisk (*)? Some examples are the following:
a,:not(a) /*9 chars*/
:nth-child(n) /*12 chars*/
:link,:not(:link) /*17 chars*/
|
Introduction
This question is inspired by this great question.
Challenge
Given a number \$N>0\$, output the largest integer \$a^b\$ that is smaller or equal to \$N\$, and the smallest integer \$c^d\$ that is greater or equal to \$N\$, where \$b>1\$ and \$d>1\$.
Output should be a list of two integers, the first being s... |
We will think of a partition as a sequence of non-increasing integers.
For a given partition into \$n_1, n_2, \dots, n_k\$ with \$n_1 \geq n_2 \dots n_{k-1} \geq n_k = n\$ we write it out with \$n_i\$ dots on row \$i\$. So for \$6, 1, 1\$ we would write six dots on the first row, one on the second and one on the third... |
Your challenge, should you choose to accept it, is to write a program in a language of your choice that, when given a string (limited to printable ASCII) as input, outputs a new program in the same language that outputs that string without using any characters from that string in the code.
But this task is impossible a... |
Task
Your boss is on another crusade for 'efficiency.' He wants to encourage the use of numbers with fewer syllables, so that they're easier to discuss in meetings. If you want to take some time off work, you're boss would prefer you take 9 days instead of 7. You're boss would prefer a credit card expense of $99,502 ov... |
Given a base \$k\$ as well as two indices (also passed in base \$k\$, call them \$s\$ and \$e\$) return a list containing a frequency count of all base-\$k\$ digits occurring between \$s\$ and \$e\$ inclusive. For example, upon input \$k = 10, s = 1, e = 10\$, we would return the list \$[0: 1, 1: 2, 2: 1, 3: 1, 4:1, 5:... |
Imagine there are \$n\$ people \$\{a_1, a_2, \ldots, a_n\}\$ who enter a room in order and sit down in \$n\$ seats, arranged in a row. Each of these people belong to some gang, indicated by an integer \$\{1, 2, \ldots, k\}\$. These gangs hate the members of the other gangs, so they want to sit as far away from those pe... |
The well-known Urinal Protocol states that each person that takes a urinal will take the one furthest from any other taken urinal. But this fails to account for short urinals; in many cases, a person would prioritize taking a taller urinal in addition to distance.
In the real world, you might struggle to find a restroo... |
Given input \$x \in \left\{0,3,6,...,90\right\}\$, output \$\sin\left(x°\right)\$ using integer and \$+ - \times \div ( ) \sqrt{\cdot}\$(square root), e.g. \$\sin(45°)=\sqrt{1\div 2}\$.
Flexible output format. You needn't do any simplification to output, aka. it's fine to output \$\sin(0°)=\sqrt{42}-\sqrt{6\sqrt{-9+58}... |
My doubles pickleball group often has five people. Four are playing and one is awaiting the next game. We can represent the state of the game with a string of five characters like abCde. This indicates that a and b are playing against c and d with c serving. We want to write a routine that gives the possible positions ... |
Given a list of positive integers, partition the list into two sublists such that the absolute value of the difference of the sums over the two sublists is minimal.
The output of the program should be the (non-negative) difference of these sums.
Examples:
[1,2,3] -> 0 # [1,2], [3]
[2,3,5,7,11] -> 0 # [2,5,7], ... |
You are given an array A of non-negative integers. You can pick any non-empty subset, S from the array A. The score of a subset S is the sum of the elements in S raised to the power of K, i.e. for a subset S={s1,s2,…,sm}, the score of S is (s1+s2+…,sm)K. Output the sum of scores over all possible non-empty subsets of A... |
Your task is to write 2 functions/programs. They may share code.
The first function must, given a string and a character, output a new string that does not contain that character.
The second function must, given the string from the previous function and the excluded character, reconstruct the original string.
All input... |
I encountered some silly code from a game and I figured this would actually turn into a fun golfing problem, so:
Given any ASCII string in the limited char range specified below.
Append as few characters as possible such that, given:
i = 1
sum = 0
for char in string
sum += char.intval * i++
end for
sum % 1000 == 0
W... |
Code Golf Challenge
Given a string of 10 characters:
'abcdefghij'
I want to format it in this pattern and print it in the console in a minimum number of characters:
(abc) def-ghij
My solution:
print(f"({s[0:3]}) {s[3:6]}-{s[6::]}")
|
One element of the list aa, ab, ba, bb, c has been removed, and the remainder shuffled and joined with no separator. Find the missing element.
For example, if the input was aaabbac, this is made by concatenating aa ab ba c, so the output would be bb.
Rules
Standard I/O rules apply.
You must take input as a string (or ... |
The challenge is simple: write a program which takes in some non-empty string \$n\$ consisting of only uppercase and lowercase ASCII letters, and outputs the code for a program (in the same language) which takes in no input and outputs \$n\$. However, the code your program generates must not contain \$n\$ as a substrin... |
Let's introduce a simplified variant of the well known Spider Solitaire.
From Wikipedia:
The main purpose of the game is to remove all cards from the table, assembling them in the tableau before removing them. Initially, 54 cards are dealt to the tableau in ten piles, face down except for the top cards. The tableau pi... |
[The explanations of the algorithm come from here. I recommend reading it for a beautiful description of the algorithm.]
This challenge is to implement the Robinson Schensted correspondence.
Input
A permutation \$\pi\$ of the integers \$\{1, \dots, n\}\$.
Output
A pair of Young Tableaux corresponding to the Robinson S... |
This is an answer-chaining post, so in this challenge every answer (except the first answer) depends on the previous answer.
The goal of this challenge is to output the restricted characters. The restricted characters are the most common n - 1 characters of all answers, if happens to be a tie, then the characters with ... |
Your task is to convert non-empty strings - between strings using the 26 letters, and programs, which are strings of bytes, where each byte has 256 possible values. You should use the same codepage your answer is written in for the possible values of bytes.
You need to do the following to do the conversion:
Convert th... |
Given two natural numbers (less than 100) as input print the sequence of intermediate results obtained when computing the sum of the two numbers using only the following operations1:
n <-> (m+1) for integers nand m satisfying that equation
(a+b)+c <-> a+(b+c) for integers a,b and c (associative law)
You are not allow... |
Provided that the input is a monotone sequence of three or more integers:
Output -2 if the sequence strictly decreases. Example: [7,4,3,2]
Output -1 if the sequence monotone decreases but is neither strict nor constant. Example: [6,5,5]
Output 0 if the sequence is constant. Example: [0,0,0]
Output +1 if the sequenc... |
Your challenge is to output the number of twisted corners given a 2x2 Rubik's Cube scramble.
For the purpose of this challenge, twisted corners are defined as corners where the colour of the top/bottom face before (usually white or yellow) is not facing the top/bottom after the scramble.
Eg. if the cube were to be orie... |
Challenge
Display to the screen or write to stdout this exactly:
**
**
****
****
****
****
****
****
****
**********
**********
**********
Winning
This is code-golf, so the shortest submission (in bytes) wins.
|
This is the inverse of "Encode the date in Christmas Eve format."
Write a program that takes as input the string Christmas, possibly followed by Eve between 1 and 365 times, and outputs the date encoded in YYYY-MM-DD format, or any format from which the year, month, and date can be easily obtained. Assume that the "Ch... |
As in, the 5 speed transmission from the original VW Golf GTI.
Print the transmission pattern in as few bytes as possible.
Yes I know this isn't what it actually looks like but the GTI 5 speed shift knob pattern is a lot worse.
1 3 5
| | |
|--|--|
| | |
2 4 R
|
Write code to generate a PDF file containing 6 bingo cards. Winner is the one that uses the shortest code and needs no actions except for installing a library and running the code. (No Save As PDF). Rules are as follows.
The generated PDF file should display accurately in Adobe's PDF reader, Google Chrome and Moxilla ... |
Your task is to calculate the amount you have to pay for prescribed medication at a pharmacy in Germany. The amount is simply based on the full price of the item, which will be your input. It is a decimal number with exactly two fractional digits (ex. 5.43). You can assume it's strictly positive. Your task is to calcul... |
There have of course been challenges to render ASCII art fonts here and there. This challenge doesn't add anything to those. In contrary, it subtracts from them for a good reason. If you allow all characters,
it's a lot of boring work
the task is mainly about clever compression of the font and short extraction
This o... |
A loaded question is something like 'Have you stopped swearing?' in which both yes and no answers mean that I have swore, meaning it is impossible to answer the question if I haven't swore.
However, the constructed language Lojban has a word na'i, which means there is something wrong with what you just said.
Your input... |
Write a program that accesses Project Gutenberg's KJV Bible, either from a file called pg10.txt in the working directory or in any other way that is typical for the language, takes a Bible verse reference as input, and prints the corresponding verse, with no newlines except optionally one at the end, as output.
The sta... |
What is the shortest sequence of moves that, from the solved state of the cube, creates a pattern that meets the following criteria:
6 colors on each face
at most 2 facelets of the same color
no adjacent facelets of the same color
EDIT: I made up the name of the pattern. I asked this question in 2018 on Mathematics S... |
The Rudin-Shapiro sequence is a sequence of \$1\$s and \$-1\$s defined as follows: \$r_n = (-1)^{u_n}\$, where \$u_n\$ is the number of occurrences of (possibly overlapping) \$11\$ in the binary representation of \$n\$.
For example, \$r_{461} = -1\$, because \$461\$ in binary is \$111001101\$, which contains \$3\$ occu... |
We need to produce a block cipher round function with a 1 bit round key size and a 7 bit message size with the highest level of cryptographic security according to our measure of security.
Introduction
We are going to need new symmetric encryption functions. We are at the point where we cannot improve the performance o... |
Write a program to print or return one of these strings verbatim:
abcdefghijkmnopqrstuvwxyz
ABCDEFGHIJKMNOPQRSTUVWXYZ
Notice that there is no L.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.