instruction stringlengths 34 53.1k |
|---|
We've all heard of the ol' Fizz Buzz problem, but what happens when you try to apply it with more factors? Fizz Buzz Crackle Pop!
The Challenge
Write a full program that takes an integer input n, then n tuples containing an integer and a string, then another integer (>1) k, as such:
n int1 str1 int2 str2 (...) intn st... |
A prime power is a positive integer n that can be written in the form n = pk where p is a prime and k is a positive integer. For example, some prime powers are [2, 3, 5, 4, 9, 25, 8, 27, 125].
Next, consider prime powers of 2. These are [2, 4, 8, 16, ...] and can be written in the form 2k. They would all be included wh... |
These are ASCII dandelions:
\|/ \ / |
/|\ | \|/ |
| | | _\|/_
| | | /|\
ASCII dandelions have three parameters: Length of the stem (positive number between 1 and 256, number of seeds (positive number between 0 and 7), and orientation (^ or ... |
Problem:
Your task is to write a program that takes as input a height (in meters) and weight (in kilograms), and outputs the corresponding BMI category.
BMI is a measure of the ratio of your weight to your height. It's dated and inaccurate for many people, but that doesn't matter here!
BMI can be calculated using the f... |
I only very recently discovered code golf and just found this part of the Stackexchange network, and naturally after looking at so many clever answers, I feel inferior. Inner me knows I'll get better over time, but inner me is also vain and needs validation.
At the same time, I don't take kindly to pandering, so you'd ... |
Write a quine, that when run, creates itself in the current directory, in a source file named itself. We will be using Windows in this, so the file name (and therefore quine) must have the following limitations:
None of these characters \ / : ? * < > |
Fewer than 211 255 characters
Limitations and assumptions
Your c... |
Feb. 6 was a real weekday. Because it lies in the 6th week of the year.
So a real weekday is a day with a a day number that equals the week number.
But not all country have the same counting of weeks. in Germany a week starts with Monday and ends on Saturday in the US they start on Sunday.
Write a program that checks a... |
Background
The 1-2-3-Tribonacci Sequence
Imagine for a second that you could make a fibonacci sequence by replacing the standard iteration formula with the following:
Basically, instead of summing the last two to get the next, you sum the last three. This is the basis for the 1-2-3-Tribonacci sequence.
Brown's Criteri... |
SmileBASIC deserves more attention. I've only seen 3 users here (including myself!) providing SB answers, and while that doesn't surprise me, it disappoints me. It being a paid lang as well as being a BASIC dialect certainly turns people off, but for those who own it it's actually pretty flexible and, surprisingly, gol... |
Take a positive integer n as input, and output (some of the) decimal numbers that can be created using n bits, ordered in the following way:
First list all the numbers that can be created with only one 1, and the rest 0 in the binary representation (sorted), then all the numbers that can be created with two consecutive... |
Rules
The program should receive a string/array of words as input. For each word in the string/array, it will reconstruct the word by taking characters in alternating fashion from the front and back of the word.
12345 678 9 -> 15243 687 9.
It will then rearrange the words in an alternating fashion between the earliest ... |
TikZ is a Latex package used for drawing precise images in Latex documents. It has a massive specification and a boatload of features that may be useful for graphical-output style questions.
What tips do people have for golfing in TikZ? As always, tips should be specific to to TikZ (e.g. "Remove comments" is not an a... |
In the location-based AR mobile game way of life Ingress the player can hack things called portals in order to get items. (If you are interested in Ingress, you can ping me in chat for more info. Trust me, it's better than Pokémon. If you end up downloading it, remember to choose the Resistance.)
A way to increase hack... |
EDIT: I'm getting a lot of comments about this not terminating - I will give the "correct answer" tag to either the first person who gives me FF(3) (as in provides it in their answer) or proves that FF(3) does indeed blow up indefinitely.
Task:
Your task is make the smallest program possible that generates the list of ... |
(I am not sure that this is the best place to put this question, but I will give it a shot. Forgive me if it is improper. This is just a fun project with which I am tinkering and I am looking for advice on how best to implement it; but it is also something of a 'challenge' (not implying that it is hard!), so I thought ... |
Input:
A maze containing the characters:
-- (horizontal wall);
| (vertical wall);
+ (connection);
(walking space);
I (entrance);
U (exit).
I.e. an input could look like this:
+--+--+--+--+--+--+--+--+--+--+
I | | |
+ +--+--+--+ + + + +--+ +
| | | | | |
+--+-... |
Introduction:
I'm a twisty puzzles collector. Here you can see my current collection of ± 300 puzzles.
I think everyone knows the regular Rubik's Cube (3x3x3 Cube), which is a NxNxN Cube. There are also Cuboids (block-shaped puzzles), which come in different forms, perhaps better explained by SuperAntionioVivaldi here:... |
Your task is to write a program or a function that prints an ASCII triangle. They look like this:
|\
| \
| \
----
Your program will take a single numeric input n, with the constraints 0 <= n <= 1000. The above triangle had a value of n=3.
The ASCII triangle will have n backslashes (\) and vertical bars (|), n+1 line... |
Your goal is to create an alphabet song as text in the following form (in order):
A is for <word starting with A>
B is for <word starting with B>
C is for <word starting with C>
...
Z is for <word starting with Z>
Example output:
A is for Apple
B is for Banana
C is for Carrot
D is for Door
E is for Elephant
F is for F... |
Intro
Something I've played around with in recreational mathematics has been construction of a divisor table to visually compare/contrast the prime divisors of a set of numbers. The set of input numbers are across the top as column labels, the prime divisors are on the left as row labels, and a mark indicates where the... |
The challenge
You are given an integer n, and you have to use these operations to make it 1.
Divide it by 3.
Divide by 2.
Subtract 1.
Examples:
Input Output
1 0 (Its already 1, guys)
5 3 (3->2->2 or 3->3->1)
10 3 (3->1->1)
255 10(3->3->3->1->1->2->2->3->1->2)
|
You will need to generate the smallest prime with n digits, and it will only contain digits specified in the list k.
Examples:
Input:
4
1 2
For this, you must generate the smallest prime with 4 digits, and that prime must only contain the digits 1 and 2.
Output:
2111
Input:
10
0 4 7
Output:
4000000007
Input:
6
5 5... |
Underload is a stack-based semi-functional tarpit created by ais523. I've recently been trying to golf in it, as it's a surprisingly elegant language.
What tips do you have for golfing in Underload? (One tip per answer)
|
A simple but hopefully not quite trivial challenge:
Write a program or function that adds up the kth powers dividing a number n. More specifically:
Input: two positive integers n and k (or an ordered pair of integers, etc.)
Output: the sum of all of the positive divisors of n that are kth powers of integers
For examp... |
You know it: keyboard or mouse input is just too mainstream to create Random Numbers through human behavior.
Create the most unique (Pseudo)Random Number Generator that create its numbers through human behavior.
Web-API's are not restricted! Anyone should use the code provided, so any special hardware is restricted. (I... |
Write a program or function that draws a tree of trees, thus constructing a forest.
The trees are drawn like stacking a pyramid. The first (top) row contains 1 tree, the next row down contains 2 (for a total of 3), the next contains 3 (for a total of 6), and so on. If there aren't enough trees to complete a full row, f... |
Background
I was inspired by 3Blue1Brown's recent video about the necklace splitting problem (or as he calls it, the stolen necklace problem) and its relationship to the Borsuk-Ulam theorem.
In this problem, two thieves have stolen a valuable necklace consisting of several different types of jewels. There are an even n... |
Find the outcome of a game of War
When I was in elementary school, there was a "Rock-Paper-Scissors"-ish game we'd play during assemblies, when waiting for our teacher, at recess etc. We called it "War". After some searching however, it turns out this is a much simpler variant of the "Shotgun Game" (according to WikiHo... |
I did the IMC this year. Did anyone else here do it?
In a UKMT Intermediate Maths Challenge paper, there are twenty-five questions. The first fifteen questions give you five marks if you get them right. For the other ten questions, you get six marks for getting them right. In the last ten questions, you lose marks if y... |
Inspired by this challenge (or, more specifically, by misreading it), I've come up with the following challenge:
Given an input string S, reverse the order of all uppercase characters, and all lowercase characters. Leave all non-letter characters in place. For instance:
Note that the uppercase W (the first uppercase l... |
In 2015 the Portland International Airport began the replacement of their iconic carpet. I want you to write a program to draw their old carpet in as few bytes as possible.
The carpet:
Specifications
Here is a link to a scalable pdf image of one tile. Your output should match the relative dimensions and placement o... |
First puzzle from me, suggestions for improvement gladly received!
The scenario is;
You work as a manager for a whitewater rafting company. Every morning, you are given a list of bookings, and you have to sort them into raft loads. Write a program or function in your chosen language that does this for you.
Each raft ho... |
Mama Say Mama Sa Mama Coosa
I'm sure all of you have heard of Michael Jackson and some of you have listened to MJ's song "Wanna be starting something". The line "Mama Say Mama Sa Mama Coosa" is repeated throughout the song.
Specification
In this line, the word "Mama"occurs three times, "Say", "Sa", "Coosa" occurs once... |
On a recent episode of QI, the first 5 multiples of 142857 were described as anagrams of the original number. Of course, anyone with more than a passing knowledge of that number will know that those numbers are actually cyclic, not just anagrams. But that got me thinking.
Please write a program or function that outputs... |
Goal:
Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.
Example solutions (TI-Basic):
A+B+1
not(A+B)
Invalid solutions:
A+B-1 (for inputs 0,0, it returns -1, which is not natural)
"ABC" (ABC is not a number)
Notes:
The output... |
Animate the text in your terminal
The goal
The goal is to "animate" the string "Hello world" in your output so that each character gets capitalised after each other.
Your program can exit after each letter has been capitalised.
For example;
# Iteration 1
Hello world
# Iteration 2
hEllo world
# Iteration 3
heLlo worl... |
Your challenge is to draw/plot one of the hearts below. The size must be at least 50x50 pixels (vector graphics is OK). You may choose which of the hearts you want to draw/plot. Axes, grid lines etc. are accepted. There must be at least 100 distinct coordinates/points on the graph. The heart can be filled with color if... |
Here's one generalized version of the famous Eight Queen's Puzzle:
Given an n × n chess board, and an integer m (≤ n). Find all possible ways to put nm Queens such that
there are m Queens at each row
there are m Queens at each column
(note that we do not impose any restriction on the diagonals).
As you might see, ... |
This is a cops-and-robbers challenge. For the robbers thread, go here.
This challenge involves two OEIS sequences chosen by the cops -- S1, S2 -- and how well those sequences can be golfed and obfuscated.
The Cops' Challenge
Your challenge as a cop is to pick a freely available language, and two OEIS sequences. Then, w... |
This is a cops-and-robbers challenge. For the cops thread, go here.
This challenge involves two OEIS sequences chosen by the cops -- S1, S2 -- and how well those sequences can be golfed and obfuscated.
The cops are constructing code A that produces S1 and giving a number X that they claim is the best Levenshtein distan... |
Your task will be to take a balanced-string and a integer representing a Levenshtein distance (the number of characters that have to be inserted, deleted or changed to make one string into another) and you must find the number of balanced strings with that distance from the original string (i.e. the neighborhood of tha... |
Background
Suppose that there are 2*n people to be married, and suppose further that each person is attracted to exactly n other people under the constraints that:
Attraction is symmetric; i.e. if person A is attracted to person B, then person B is attracted to person A.
Attraction is antitransitive; i.e. if person A ... |
The challenge
Your task is to decode the first character in a UTF-8 byte sequence. The input is a byte array or a byte string holding a UTF-8 byte sequence.
If the (start of the) sequence is valid, the output is the Unicode code point of the first character in the sequence which is a number between 0 and 0x10FFFF. Your... |
Right hand brace is a style of code bracketing in which curly braces and semicolons are all aligned to a single point on the right side of a a file.
Generally, this is considered bad practice, for several reasons.
The Challenge
Take a multiline string through any method, and convert it's brace style to Right Hand Brac... |
The lambda calculus is a system of functional programming. Lambda calculus consists of variables, abstractions, and applications.
A variable is simply a name denoting a function parameter. It is a single letter. An abstraction is a "function literal" of sorts, it consists of a backslash \ followed by a variable name, a... |
Inspired by this challenge
Goal:
The goal is to draw waves crashing onto a beach.
Input:
You will be given 3 integers (in whatever format you want) as input.
The first integer will be the length of the drawing
The second integer will be the index of the sandbar, where the waves start to crest (at least 3 spaces from ... |
Sound synthesizers use envelope generators to control how certain parameters of the sound (such as overall loudness) change with time. In many synthesizers an envelope is defined by four parameters, as represented in the following figure from Wikipedia:
Attack time (A): time taken for the envelope to reach its maximum... |
Your task is to write a program that:
Runs indefinitely
Produces no output
Consumes an unbounded amount of memory
Specifications
You must list the implementation used for your program. This is relevant because some implementations might preform optimizations while others do not. For example, the LISP code (defun f (... |
A Woodall Prime is a prime which can be calculated, given a positive integer n, with n * 2^n - 1.
Your task is to, given a integer k, generate a Woodall Prime with k digits. If no such Woodall Prime exists, you must generate a Woodall Prime with the closest amount of digits. If two primes exist with the same digit coun... |
Your task is to find how many distinct Blackjack sequences can be found in an ordered list of 12 cards.
A Blackjack sequence is defined as a sequence of consecutive cards whose sum of points is exactly 21. Points are counted according to the following table:
Symbol | Name | Points Symbol | Name | Points
-------+-... |
This is a cops-and-robbers if you are not familiar with the format click the tag to go to the wiki. There will not be a robbers' thread for this question.
Cops
Your task as Cops is to select two sequences from the Online Encyclopedia of Integer Sequences and write a program that takes the nth element of one sequence a... |
This challenge is to output to your terminal, window, canvas or screen the numbers zero to 10 inclusive. Each outputted number must be shown as a 4-bit wide nybble, so zero must show as 0000 and so on.
You may separate each number outputted with a space, comma or carriage return. Smallest solution wins but the numbers ... |
I'm a developer, and I don't feel like doing my work. I know from XKCD that the best excuse for slacking off is that your code's compiling. Because of this, I think I need some code that will compile forever! And because I'm lazy and don't want to have to type much, this has to be done with the shortest code possible.
... |
Gray Code is a number system where only 1 bit of the number changes from one number to the next number. Print the 8 bit Gray Code values of 0 to 255.
Shortest Code wins!
Start of output:
0 00000000
1 00000001
2 00000011
3 00000010
4 00000110
5 00000111
6 00000101
7 00000100
...
You only have to print the Gra... |
Input
A string that contains at most one of each of the letters A, B, and C. They may be in any order. The empty string is valid input.
Note: A previous version of this challenge used the letters LEJ instead of ABC and they may still be used if desired.
Output
A string of the A, B, C letters that were not present in th... |
Objective
Given an input list of 6 distinct digits, find 3 numbers a, b and c such that a × b = c, with a having 2 digits, b having 1 digit and c having 3 digits. In a more visual way, your program must arrange those 6 digits in the boxes of this image:
If more than one solution exists, you may output any of them.
Inp... |
The task
Write a program or function that given three strings A, B, C produces an output string where each instance of B in A has been recursively substituted with C.
Recursively substituting means repeating a substitution where at each step all non-overlapping instances of B in A (chosen greedily from left to right) a... |
Challenge:
Create a function or program that will take an input N (a number from 0 - 24) which represents the HOUR.
Output should draw an analog clock out of asterisks showing the hour N.
Notes:
•The minute hand must be longer than the hour hand (in terms of number of asterisks used)
•The minute hand must be at least... |
AWG (American Wire Gauge) is a common way of specifying wire sizes. Your task in this challenge is to convert from a given gauge to the diameter of the wire in inches.
The size in inches for the gauges from 4/0 to 40 are shown in the table below:
Gauge to inches table
| AWG | Diameter (Inches) |
|-----|----------------... |
A Graceful Graph is a type of Simple Graph. Graceful graphs are special because there is a way to label all their nodes with positive integers so that when the edges are also labeled with the differences of the nodes they connect, no two edges have the same label and every label up to the number of edges is used.
Work... |
I find NullPointerException to be interesting since there are no explicit pointers in Java. Here is a program that throws such an exception.
class c {
public static void main(String[]s) {
throw new NullPointerException();
}
}
What is the shortest Java program that throws NullPointerException?
|
Make a function, method, program or routine that will accept two interger parameters (say x and y) and the total of the two values multiplied. Except straight multiplication is not allowed so you must not simply do something like:
int multiply (int x, int y) {
return x*y;
}
Also you must not use a for () loop, lik... |
Inspired by this listing from the Commodore 64 User's Guide:
10 PRINT "{CLR/HOME}"
20 POKE 53280,7 : POKE 53281,13
30 X = 1 : Y = 1
40 DX = 1 : DY = 1
50 POKE 1024 + X + 40 * Y, 81
60 FOR T = 1 TO 10 : NEXT
70 POKE 1024 + X + 40 * Y, 32
80 X = X + DX
90 IF X <= 0 OR X >= 39 THEN DX = -DX
100 Y = Y + DY
110 IF Y <= 0 OR... |
This challenge is inspired by Mathematics is fact. Programming is not.
The mathematical notation for a factorial, or a fact is an exclamation mark !. The exclamation mark is also a common symbol for not in many programming languages.
Challenge:
Take a string, containing numerals, and the characters: + ! as input and o... |
Objective
Generate the original scrambled list, from the movements that an Insertion Sort would do to sort it.
The original list will have all numbers from 0 to N-1(inclusive) where N is the size of the input.
Input
A list containing the necessary moves to sort the list. Each value represents the amount of slots displa... |
Here's a scenario:
A grandmother and grandfather forget what their GMail password is. They know the word, but can't remember which letters are capitals.
The challenge is to take a word given and print(stdout) every combination of capital letters possible, essentially "brute-forcing" but only on a given string.
Example... |
In any programming language, create a program that takes input and animates the text being typed on a keyboard.
The delay between each character should be varying to simulate true typing on a keyboard. The delay shall be 0.1, 0.1, 0.5, 0.1, 0.1, 0.5 ... seconds, until the last character is printed. The final output sha... |
The Euclidean algorithm is a widely known algorithm for calculating the greatest common divisor (GCD) of two positive integers.
The algorithm
For the purpose of this challenge, the algorithm is described as below:
Display the two input as adjacent lines of a certain character
e.g. an input of 3,4 can be represented by... |
The first Predecessor-completed Ascii Cube (PAC 1) is a simple cube with side length 1 and looks like this:
/////\
///// \
\\\\\ /
\\\\\/
The PAC 2 is a geometric shape such that combining it with its predecessor (the PAC 1) completes a side length 2 cube:
front back
/////////\ /... |
Your task is to write code that will leak at least one byte of memory in as few bytes as possible. The memory must be leaked not just allocated.
Leaked memory is memory that the program allocates but loses the ability to access before it can deallocate the memory properly. For most high level languages this memory ... |
Background
Consider a sequence defined as follows:
The first element is 0;
The second element is 4;
From the third element onwards, its value can be calculated by:
Taking the set of integers from 0 up to the previous element of the sequence (inclusive or exclusive, it doesn't matter);
Removing any integers that have... |
Summary
The goal of this challenge is to create an undone image-version of a 15-puzzle / sliding puzzle also called taquin in french.
Details:
Given an input composed of:
an image,
an integer n,
an other integer r,
your program, or function, or anything else that fits, must output the same image (i.e. same size and f... |
There have been a couple of previous attempts to ask this question, but neither conforms to modern standards on this site. Per discussion on Meta, I'm reposting it in a way that allows for fair competition under our modern rulesets.
Background
A palindrome is a string that "reads the same forwards and backwards", i.e... |
Given two integers greater than one, A and B, output four mathematical expressions in this order:
The plain expression A^B (A to the power B). e.g. if A = 2 and B = 3, 2^3.
The expansion of A^B in terms of repeated multiplications of A. e.g. 2*2*2.
The expansion of A^B in terms of repeated additions of A. e.g. 2+2+2... |
Introduction
According to the Riemann Hypothesis, all zeroes of the Riemann zeta function are either negative even integers (called trivial zeroes) or complex numbers of the form 1/2 ± i*t for some real t value (called non-trivial zeroes). For this challenge, we will be considering only the non-trivial zeroes whose ima... |
Inspired by Expand exponentation.
Knuth's up arrow notation is used for big numbers such as Graham's number.
If we look deeper, we can see how it makes big numbers.
One arrow means exponentiation. e.g. 2↑3 equals 2^3 = 8.
Two or more arrows means repeating the instructions of n-1 arrows. e.g. 2↑↑3 equals 2↑2↑2 equals 2... |
Summary:
For any given language, what is the smallest amount of unique characters for your language to be Turing-Complete?
Challenge:
For any language of your choice, find the smallest subset of characters that allows your language to be Turing-Complete. You may reuse your set of characters as many times as you want.
... |
An Abundant number is any number where the sum of its proper divisors is greater than the original number. For example, the proper divisors of 12 are:
1, 2, 3, 4, 6
And summing these results in 16. Since 16 is larger than 12, 12 is abundant. Note that this does not include "Perfect numbers", e.g. numbers that are equa... |
You've recently made an account on a dodgy gambling site, where for a fee of 25 dollars, they will pay you back a random amount between 0 and 50 dollars. After getting around 5 dollars twice, you decide to prove the site is a scam. After accessing their external firewall with the default password, you find your way ont... |
Given a semiprime N, find the smallest positive integer m such that the binary representation of one of the two factors of N can be found in the binary representation of N * m.
Example
Let's consider the semiprime N = 9799.
We try different values of m, starting at 1:
m | N * m | N * m in binary
---+--------+------... |
The Recursively Prime Primes is are sequence of primes such that
p(1) = 2
p(n) = the p(n-1)th prime
Here is an example of how one might calculate the 4th Recursively Prime Prime.
p(4) = the p(3)th prime
p(3) = the p(2)th prime
p(2) = the p(1)th prime
p(1) = 2
p(2) = the 2nd prime
p(2) = 3
p(3) = the 3rd prime
p(3) = 5... |
FizzBuzz is so simple, bet you can do it backwards. In this challenge, you will be given the length of the FizzBuzz string and must give the positive integer that produced that string.
Description
To break this down, a FizzBuzz string for n is generated by the following algorithm.
Start with an empty string and, for e... |
Your task is to calculate the expected chance of winning for 2 players in some game, each with their own ELO Rating. Player A has ELO Ra and player B has ELO Rb
The expected score for Player A (Ea) is: 1 / (1 + 10(Rb - Ra) / 400). There is a similar equation for Player B (Eb): 1 / (1 + 10(Ra - Rb) / 400).
If you want a... |
When I was a kid, and wanted to count the dollar bills in my life savings, I would count out loud:
one, two, three, four, five, six, seven, eight, nine, ten;
eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty;
twenty-one, twenty-two, twenty-three, twenty-four, twenty-five..... |
A word search is a matrix of letters as defined in Word Search Puzzle Generation. For a word search to contain a word, it means that that word appears somewhere in the matrix horizontally, vertically, or diagonally.
Your task is to write a program that takes a list of strings and outputs the dimensions of the smallest-... |
Sometimes, when writing a program, you need to use a prime number for some reason or other (e.g. cryptography). I assume that sometimes, you need to use a composite number, too. Sometimes, at least here on PPCG, your program has to be able to deal with arbitrary changes. And in circumstances conveniently contrived to m... |
Your task is to slowly calculate exponentiation, with the following steps:
Given two inputs (in this example, 4 and 8), you must calculate the exponentiation by calculate the equation bit by bit. You would do 4^8, have a greater base value (4) and a smaller exponent (8). You can do this using more exponentiation and di... |
Challenge
Make the shortest program to determine if the figures in the input will fit into the space in the input.
Requirements
The input will be in the format of this example:
Input:
+----+ -- +--+
| +----+ | |
| | +--+
| |
+---------+
Output:
+----+
|+--++----+
|| |-- |
|+--+ |
... |
Input
Two words separated by a space. It is assumed that the first is a verb.
Output
The "Soviet counterpoint" to the input phrase, in the form of a punchline to an "in Soviet Russia" joke.
"break law" --> "In Soviet Russia, law break you!"
Accounting for correct grammar is unimportant.
Shortest program wins!
|
Task is to output this text:
ABCDEFGHIJKLMNOPQRSTUVWXYZA
A 00000000000000000000000 Z
B Y
C 101010101010101010101 X
D W
E V
F 2101210121012101210 U
G T
H S
I R
J 123210... |
Your input will be a string consisting of small english letters.
Your task is to determine the number of distinct permutations of the original string that are a palindrome.
The input string has up to 100 letters. In the case of a longer string the result might be very big so the output should be the number of permutati... |
In the wake of the many (two?) FizzBuzz-related challenges posted recently on PPCG, I've been tempted to come up with my own. Behold...
Fizz Buzz Lightyear
Write a program or function that takes an integer n and prints out FizzBuzz for any number divisible by 15, Fizz for any number divisible by 3, and Buzz for any num... |
Most computer keyboards feature a small integrated LED light,
indicating the current input mode, as controlled with the CAPS LOCK button.
Your task is to blink it:
Turn it on;
Wait for 0.5 (+/-0.1) seconds;
Turn it off again.
Video footage of the LED blinking is highly appreciated !
Rules
You can blink a different ... |
Background
On this site, we occasionally have questions requiring programs to be "radiation hardened"; this means that the program has to be able to survive the deletion of one or more bytes, no matter which bytes are deleted.
As is common for tasks that frequently get set in programming challenges, it's natural to wan... |
When using a tool such as git to merge two files, a conflict could be detected and added to the result of the merge.
A merge of these two files:
my file:
Common line of code 1
Common line of code 2
my lines
Common line of code 3
Common line of code 4
their file:
Common line of code 1
Common line of code 2
their lines
... |
Intro
When you search in google, it always shows you a result with a sample text from the found webpage.
For example if you search for "Madonna greatest vinyl", google will show you one line link, and below a short excerpt from that found webpage:
Madonna Greatest Hits Records, LPs, Vinyl and CDs
Madonna - Greatest Hi... |
Some of you may be familiar with the way that a motorcycle shifts. But for those who don't, It looks like this
6
5
4
3
2
N
1
Now I want to know what gear I am in after performing a few up and down shifts.
The program should work from neutral.
Sample input:
V^^
Sample output:
2
As you can see I downshifted once from ... |
You're in charge of distributing T-Shirts to everyone. Simple enough, right? But remember, there are different sizes of T-Shirts, and you have to keep that in mind...
Challenge Specifications
There are N T-Shirt sizes. There are K people. Each person may wear any T-Shirt that is larger than them, but they can only wear... |
You know those Windows boxes where you can only do one thing?
Let's take this to the next level!
Challenge
Make a dialog box with a button that follows your cursor everywhere!
Specs
No input may be taken. There may be output to either STDOUT or STDERR. You must open a window with one button (no text is necessary, but ... |
In this challenge, you need to simulate a frog jumping back and forth on lily pads. The pond is infinitely big, has a line of an infinite number of lily pads, and the frog can jump across as many lily pads as he likes.
This frog likes to jump back and forth: after jumping forward, he always jumps backwards, and vice ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.