instruction stringlengths 34 53.1k |
|---|
Your program is given a string consisting entirely of lowercase letters at STDIN (or closest alternative). The program must then output a truthy or falsey value, depending on whether the input is valid romaji.
Rules:
It must be possible to divide the entire string into a sequence of kana without any leftover characte... |
Your challenge is to take a name (string) as input, like
Albert Einstein
and output:
Einstein, Albert
Pseudocode:
set in to input
set arr to in split by " "
set last to the last element of arr
remove the last element of arr
set out to arr joined with " "
prepend ", " to out
prepend last to out
output out
More test c... |
In Rocket League, there are controls assigned to quick chat. For PC, they are
1, 2, 3, and 4. To use a quick chat, you must press two controls. For example, the first option would be 1, 1.
You will be simulating the Rocket League client. You will be given a non-empty list composed only of four characters of your choosi... |
Because we haven't had enough of these, let's do another weird language!
+ increments the accumulator
- decrements the accumulator
# outputs the character with the codepoint of the accumulator modulo 127, and then resets the accumulator
$ is like # but it doesn't reset the accumulator
% reads a single character of inp... |
A Directed Acyclic Graph (DAG) is a type of graph that has no cycles in it. In other words, if there is a link from node A to node B, there exists no path from B to A (via any nodes).
Challenge
Determine whether the directed graph given as input is acyclic.
Input
A list of lists of integers representing the links betwe... |
Suppose you have two six-sided dice. Roll the pair 100 times, calculating the sum of each pair. Print out the number of times each sum occurred.
If a sum was never rolled, you must include a zero or some way to identify that that particular sum was never rolled.
Example Output:
[3, 3, 9, 11, 15, 15, 11, 15, 7, 8, 3]
... |
Introduction
Sometimes I get bored and there are no new questions on PPCG, so I want you to dig a random question from PPCG's past.
Challenge
Given a user's PPCG ID as input (e.g. my ID is 30525), output the URL of a randomly chosen PPCG question. If the question does not meet the following criteria, you must choose an... |
Introduction
Alice is a 2-d language by Martin Ender which has two different execution modes, cardinal and ordinal. When the instruction pointer passes through a mirror (either / or \), it switches from one mode to the other one.
In this challenge we will focus on ordinal mode, where commands operate on strings and the... |
Contest permanently opened - Updated August 10th 2017
Even though on June 5th 2017 I declared a winner (who will be kept as the best answer) I'll be rnning new bots and updating the results.
June 5th Results
Congratulations user1502040
Since there are no ties, I only show the % of matches won.
Statistician2 - 95.7%
Fit... |
A common year is a year that is not a leap year and where the first and last day of the year are on the same day. A special common year is one that starts on a Monday and so ends on a Monday as well.
Your challenge is to create a program/function that when given a year as input finds the nearest special common year, o... |
Input:
The input will be a string of any characters.
Output:
the output will be an emojified (discord emojis) version of the input string. The way it will work is as so:
Letters: a-z (case insensitive) will become ':regional_indicator_lowercase letter here:'
e.g 'A' will become ':regional_indicator_a:'
Digits: any digi... |
Given 2 non-negative integers as input, output a non-negative integer that cannot be created through any mathematical operators on the 2 inputs.
For example, given inputs 2 and 3, 6, 0, 5, 1, 9, 8, 23, 2 are all invalid outputs.
Operations that must be taken into account are:
Addition (a + b)
Subtraction (a ... |
Given a list or delimited string, output a list or delimited string with the first character of each word one word later.
For this challenge, a "word" consists of only all printable ASCII characters, except the space, newline, and tab character.
For example, take the string "Good afternoon, World!" (space-delimited):
1... |
A Pythagorean Triple is a positive integer solution to the equation:
A Trithagorean triple is a positive integer solution to the equation:
Where Δn finds the nth triangular number. All Trithagorean triples are also solutions to the equation:
Task
Given a positive integer c, output all the pairs of positive integers... |
According to this XKCD comic, there is a formula to determine whether or not the age gap in a relationship is "creepy". This formula is defined as:
(Age/2) + 7
being the minimum age of people you can date.
Therefore a relationship is creepy if either of the people in said relationship are younger than the minimum age ... |
Challenge
Weirdly, this hasn't been done yet: output the current date.
Rules
The date format you should follow is as follows:
YYYY-MM-DD
Where the month and day should be padded by zeroes if they are less than 10.
For example, if the program is run on the 24th May 2017, it should output
2017-05-24
The date can either... |
Klein is a 2D language I have designed that can be embedded on 12 different topological surfaces. A Klein program can be run on different surfaces by changing the command line arguments.
The topology determines where the instruction pointer goes when it goes off the edge of the program. When moving off of the edge th... |
Inspired by: Find an Unrelated Number
Challenge
Given two positive integers as input, output the mathematical operations that can be used on those inputs to generate every number from 1 to n inclusive where n is the smallest prime greater than the sum of the two inputs. If the number cannot be generated using the list... |
Related to: Make a ;# interpreter and Generate ;# code
;# - A Whirlwind Guide
This is a simple language with two commands. Its only data structure is an accumulator, which is initialized to 0.
; Increment the accumulator
# Calculate the value of the accumulator modulo 127, and print the corresponding ASCII character.... |
I'm new to this code-golfing thing and I'm very interested in CJam.
Is there a way to get all the current stack as an array? I think I can do it with something like [1$ 2$...n$] but I would have to get the stack's length and use some kind of iterator (or use a fixed length stack... useless). But is there a way to achie... |
Given a string as input, output a number of whitespace characters (0x0A and 0x20) equal to the length of the string.
For example, given the string Hello, World! your code would need to output exactly 13 whitespace characters and nothing else. These can be any mix of spaces and newlines.
Your code should not output any ... |
Challenge
Given a Youtube playlist, output the number of videos in it.
I/O
The playlist will be given as an URL; for example, https://www.youtube.com/playlist?list=PL_3jnZNPYn7qUatgDYBS5NShkfXoehSRC (this is a playlist a friend sent me to try to get me to listen to K-Pop because she's obsessed with it and I don't like ... |
Inspired by the recent craze over another two character language, ;#
Intro
According to community consensus, acceptable answers on this site must use programming languages that, at minimum:
Can determine if a natural number is prime
Can add two natural numbers together
Can represent a list/tuple of numbers, as well as... |
Introduction
Apparently, this question has been asked here and it unfortunately closed. I thought it was a good idea to try again with it, but done right.
XKCD looks at the how we are trained to use "hard to remember passwords", thinking it's secure, but instead, would take a computer 3 days to crack. On the flip side... |
As a couple of people may have noticed lately, I've largely abandoned development of Braingolf because it's boring and uninspired, and moved on to 2Col which is a little more interesting, and not designed to be a golfing language.
The defining feature of 2Col is that every line of code must be exactly 2 characters long... |
For today's challenge, you must write a program or function that alternates the case of a string. However, you must ignore non-alphabetic characters. This means that every alphabetic character must have a different case than the preceding and following alphabetic character. This is slightly more complex than uppercasin... |
The input will be two five letter words. They don't actually have to be dictionary words, just any five letters each, all lowercase or all uppercase, your choice. Only A-Z will appear in the input words and they will always be 5 characters in length.
Your program is to score them both as though they were poker hands an... |
Task
Write a program or function that, given a string and a list of strings, replaces each occurrence of an element of the string list contained in the string with the next element of the string list.
Example
The string is The cat wore a hat on my doormat so I gave it a pat and the list is ["at","or","oo"], we observe ... |
I cannot believe that this hasn't been done before but I may be wrong. If so, just close as dupe.
This challenge is very similar to Is it truthy or falsy? but, IMO, isn't close enough to be a dupe. That has predefined "falsy" variables that all languages must use, some of which aren't even falsy; this uses your own fal... |
A CSS selector is made up of five elements:
The element type (tag name)
The id of the element
The classes of the element
The attributes of the element
Operators to chain these element selectors
This challenge will only involve the first four--also taking into account operators would make more than one element be gen... |
Given one of the 50 U.S. state names on the left as input, output its two-letter postal code as shown to the right:
Alabama AL
Alaska AK
Arizona AZ
Arkansas AR
California CA
Colorado CO
Connecticut CT
Delaware DE
Florida FL
Georgia GA
Hawaii ... |
Introduction
A while ago a lost SO user posted a question here and its now been deleted but I think it would make a good challenge so here it goes...
Challenge
Write a full program or function that takes two strings and checks whether any permutation of the first string is a sub-string of the second string.
Input
Two s... |
You are to golf a program that will take a filename as input and you must output what color the file is.
The file will have any one of these extensions but your program only needs to support one. Please say which one in your answer.
.jpg
.png
.svg
.gif
.bmp
And now to the classic layout.
Input
A filename with one of ... |
Introduction
Ever heard of Remind? No? Neither did I until about 2 years ago. Basic premise of it is for teachers to send out reminders and communicate with their students. Pretty neat, right? It even allows you send emotes and react to messages! Which I do on a daily basis.
But, one thing about Remind is that the teac... |
In the musical rendition of Les Miserables, a song appears called "Red and Black." Here is part of that song:
Red - the blood of angry men!
Black - the dark of ages past!
Red - a world about to dawn!
Black - the night that ends at last!
Source.
Your task is to turn input into a resounding "Red and Black" anthem.
Inpu... |
Given an unordered collection of positive integers by any reasonable input method, return all of the sub-collections that have an odd number of odd elements (i.e. have an odd total).
This is code-golf so you should aim to minimize the byte count of your program.
Since some languages only have ordered collections (lists... |
I see from this SMBC comic that Zach Weinersmith is offering a generous 14 points to anybody who can find a way of generating the following series:
0, 1, 4, -13, -133, 52, 53, -155
Now, we all know that there are infinite ways of generating any given numeric series, so Zach is clearly just giving those points away. Bu... |
In probability theory, the normal (or Gaussian) distribution is a very common continuous probability distribution. Normal distributions are important in statistics and are often used in the natural and social sciences to represent real-valued random variables whose distributions are not known.
The challenge
Your chal... |
Eyeballing the binary values printed as ovals and sticks is not so easy...
To help with that, you must write a function (or a program) that prints numbers in custom binary representation.
So I want to take a number, say 3 (00000011) and output the bits in user-defined format, for example with space separated pairs:
0... |
Write a program that outputs all possible Tic Tac Toe positions including the corresponding game outcome. Avoid duplicate output of equal positions.
The program takes no input.
Rules:
A position output must consist of 9 characters, using X and O for the taken squares, and an arbitrary non-whitespace character for the ... |
An addition chain is a sequence of integers starting with 1, where every integer other than the initial 1 is a sum of two previous integers.
For instance, here's an addition chain:
[1, 2, 3, 4, 7, 8, 16, 32, 39, 71]
Here are the sums that make it an addition chain:
1 + 1 = 2
1 + 2 = 3
1 + 3 = 4
3 + 4 = 7
1 + 7 = 8
8 +... |
Given a string, reverse it interleavingly. Here's how to do it for abcdefghi and abcdefghij, 0-indexed:
Separate the chars at even indices from the chars at odd indices:a c e g i
b d f h
a c e g i
b d f h j
Reverse the chars at odd indices:a c e g i
h f d b
a c e g i
j h f d b
Interleave into one string again:ahcf... |
Your task is to write a function which outputs a ukulele chord chart in the following format for a given chord symbol. For instance, for input "G7", it must output:
G C E A
---------
| | |#| |
---------
| |#| |#|
---------
| | | | |
---------
| | | | |
---------
| | | | |
---------
It must support all chords of thes... |
We've all seen the signs on motels telling us if there's a vacancy or not:
Typically, these will permanently have the letters of VACANCY lit up, and have the letters of NO lit up if there isn't any room in the motel.
The challenge
The average motel in the U.S. has 200 rooms.
You will write a program/function that take... |
Your task is simple: Write a program that can be run in two languages. It should be a normal quine (prints its own source code) in language 1, and should be an error quine (generates an error message identical to its own source code) in language 2.
This is code-golf, so the shortest valid submission (in bytes) wins.
Ru... |
Definition
In Mathematics, Harmonic Sequence refers to a sequence where
$$a_n = \frac 1 n$$
i.e. the \$n_{th}\$ term of the sequence equals the reciprocal of \$n\$.
Introduction
In this challenge, given a positive integer \$n\$ as input, output the Partial Sum of first \$n\$ terms of the Harmonic Sequence.
Input
Yo... |
'---------'
'-'.repeat(9) // longer!
'------------'
(x='----')+x+x
'-'.repeat(12) // same length
Is there any cleverer way of generating strings of 12 repeated characters in JavaScript?
|
I got the spontaneous idea of making a series of challenges of users that have helped and continue to help the PPCG community be an enjoyable place for everyone, or maybe just specifically for me. :P
If you convert Dennis's name to an array of 1s and 0s where each consonant is 1 and each vowel is 0, the array is [1, 0,... |
Given a stream of bits, output the shortest possible Hamming code that encodes it.
The steps to generate the Hamming code are as follows, although your submission does not necessarily have to conform to them as long as it produces identical output. The input 110100101 will be used as an example.
Pad the input with tra... |
Background
As noted in the PPCG challenge Compress a maximal discrepancy-2 sequence – which inspired this challenge – the authors of the paper Computer-Aided Proof of Erdős Discrepancy Properties found a maximal discrepancy-2 sequence, namely
-1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, ... |
A cyclic number is a number of "n" digits that when multiplied by 1, 2, 3,...n, results in the same digits but in a different order.
For example, the number 142,857 is a cyclic number since 142,857 x 2 = 285,714, 142,857 x 3 = 428,571, 142,857 x 4 = 571,428, and so on. Given an integer input, determine if it is a cycli... |
Also known as the [analog root]
(Opposite of the digital root!) ;)
The digital root of a number is the continuous summation of its digits until it is a single digit, for example, the digital root of 89456 is calculated like this:
8 + 9 + 4 + 5 + 6 = 32
3 + 2 = 5
The digital root of 89456 is 5.
Given a digit as input vi... |
Kids who are learning how to count often know runs of numbers, but can't seem to put those runs together properly.
For example, they might say:
1,2,3,4,7,8,9,10
Sometimes kids will realize that they skipped some numbers, and go back:
1,2,3,4,7,8,5,6,7,8,9,10
This is clearly the superior pattern. We need to identify ... |
This is a throwback challenge. You will choose an old computer system and an old language created for that system.
The challenge
Pick an old computer system that was made before the year 2000. In a programming language that was created to run on that system, print said system's logo.
Example systems, their languages, a... |
Challenge
Your program needs to take an input of a string, where the string has only letters, no special characters, no numbers, and no accents (they look all weird).
Then, your program should output a superscript version.
Example
Input: hello world
Output: ʰᵉᶫᶫᵒ ʷᵒʳᶫᵈ
Test Cases
hello - ʰᵉᶫᶫᵒ
code - ᶜᵒᵈᵉ
golf - ᵍᵒᶫᶠ
a... |
The challenge
You're given:
a non-empty, unsorted list h of positive integers (the haystack)
a positive integer n (the needle)
Your task is to return the list of all unique decimal concatenations of permutations of h whose binary representation contains the binary representation of n.
Examples
h = [ 1, 2, 3 ]
n = 65... |
The purpose of the challenge is to approximately plot the attractor of the logistic map as a function of its parameter r (also called bifurcation diagram), or a subregion of it. The appearance of the graph can be seen in the following image from Wikipedia:
Background
The logistic map is a mathematical function that ta... |
Introduction
I don't particularly know where the fizz buzz trend came from. It might just be a meme or something, but it is somewhat popular.
Challenge
Your job today is to convert Fizz Buzz into binary (0, 1) respectively, and convert that binary to text. Pretty standard stuff.
How does that work?
FizzBuzzBuzzFizzBuzz... |
While writing my essay for Shakespeare, I realized that I needed to shorten my quote references to more manageable lengths. I had previously been writing this:
(Act 1, Scene 2, Lines 345-346)
But I've now been told to write them like this:
(I.ii.345-6)
Clearly, I need some golfed code to golf my Shakespeare quote ref... |
Buzzby Berkeley Robot Hokey Pokey
Task
Write a program or function to produce an ASCII art animation depicting a line of robots dancing to the lyrics of the Hokey Pokey (or Cokey, if you prefer) in the style of a Busby Berkeley number!
Example Output
Input
Accepts three arguments (assumed to be valid):
N = number of r... |
Hex triplets such as #ffffff (white) or #3764ef (blueish) are often used to denote RGB colors. They consist of # followed by six hexadecimal digits (0-f), or sometimes three digits where the real color is obtained by doubling each digit. For example, #fff is #ffffff and #1a8 is #11aa88.
Sadly, that three digit shorthan... |
Before I begin, this challenge was not mine originally
Credits to The University of Waterloo. This came from the Canadian Computing Competition 2016, Senior Problem 5. Here is a clickable link to the contest PDF:
http://cemc.uwaterloo.ca/contests/computing/2016/stage%201/seniorEn.pdf
Here is a link to the site:
http://... |
This is a challenge about the the tricks and optimizations that can be used when golfing in CJam. CJam golfers may recognize many of the tricks involved. However, unfamiliar approaches and constructs may be involved, so take a look at the CJam tips as well as the CJam instruction reference if you get stuck. Solutions m... |
Sometimes, while golfing, one needs to represent large number(s) in their code. Writing them as is can significantly increase the byte-count.
What general1 tips do you have for representing long numbers concisely in code?
Please post one tip per answer.
1With general, I mean tips that can be applied to more than a sin... |
My previous challenge, Print invisible text was quite popular, likely due to how trivial it is.
However those more observant of you may have noticed that you're not really printing invisible text, because it's impossible to read what was inputted given only the output.
So I figured how about a real invisible text chall... |
A simple one:
Take a positive integer n less than 1000, and output the integers from 1 to n interleaved with the integers from n to 1. You must concatenate the numbers so that they appear without any delimiters between them.
Test cases:
n = 1
11
n = 4
14233241
n = 26
1262253244235226217208199181017111612151314141315... |
Steven Gerrard was born on 30th of May 1980. He is now 37 years old. Happy birthday, Steven!
To celebrate his anniversary, your goal is to remind him the number of goals he has scored each year in premiere league for Liverpool.
He doesn't want to remember the goals scored before or after playing for Liverpool. It is l... |
Challenge
Hi, given a string as input, remove any salutations found at the start of the string.
The program which performs the most correct substitutions in under 50 bytes wins.
Salutations
Hey, a salutation is defined as one of the following words:
hi
hey
hello
dear
greetings
hai
guys
hii
howdy
hiya
hay
heya
hola
hih... |
Goal: This goal to take a string and output how many contributions should be made on which days in order to display a message.
Specification
Input
Support letters plus space (i.e. [A-Za-z ] )
Space is a blank 3X7
The letters are defined in this 5x7 DOT Matrix font provided below
The size of each letter is the minim... |
For Gregorian calendars, the date format varies from a country to another. There are three main formats recognized:
YY-MM-DD (big-endian)
DD-MM-YY (little-endian)
MM-DD-YY (middle-endian)
Your task is to write a program which, given an input string representing a date, output all the possible date formats by which th... |
Challenge
Given a non-empty string S of length L consisting entirely of printable ASCII chars, output another string of length L that consists entirely of printable ASCII chars, but is not equal to S.
For the purposes of this challenge, a printable ASCII char is one between U+0020 and U+007E, inclusive; that is, from ... |
Overview
In this challenge, you will be given two numbers which are both a small offset larger than a multiple of a medium-size number. You must output a medium-sized number that is almost a divisor of both of the numbers, except for a small offset.
The size of the numbers involved will be parameterized by a difficulty... |
The Straddling Checkerboard is a method for converting letters to numbers and was part of a pencil an paper cipher known as VIC
To convert letters to numbers first you have to make a checkboard like this:
0 1 2 3 4 5 6 7 8 9
---------------------------------------
E T A O N ... |
You must fill an array with every number from 0-n inclusive. No numbers should repeat. However they must be in a random order.
Rules
All standard code-golf rules and standard loopholes are banned
The array must be generated pseudo-randomly. Every possible permutation should have a equal probability.
Input
n in any way ... |
Given a non-negative integer N, output the smallest odd positive integer that is a strong pseudoprime to all of the first N prime bases.
This is OEIS sequence A014233.
Test Cases (one-indexed)
1 2047
2 1373653
3 25326001
4 3215031751
5 2152302898747
6 3474749660383
7 3415500717... |
Everyone knows log scales are for quitters. Therefore, you must write a program or function that de-quitifies a bar graph with a log scale given a base.
The bar graph input is taken as a single string which is a list of bars, where each bar of the log scale bar graph is separated by the printable (or whitespace) delimi... |
Challenge
Write two programs that:
run in two different programming languages.
These may not be two versions of one language.
when one program is run, it outputs the second program, and vice versa.
The two programs must be different (no polyglots).
Here's the catch though:
The programs must be radiation hardened.... |
In this challenge, you must take a string matching the regex ^[a-zA-Z]+$ or whatever is reasonable (you don't have to consider uppercase or lowercase letters if you want) (you may assume the string is long enough, and has the right structure for all the operations), and output another string, produced similarly to word... |
Simple challenge inspired by the popularity of my previous print invisible text and print real invisible text challenges, and the same length different string challenge.
Given a string consisting of only printable characters (0x20 to 0x7E), print every printable character not present in the string.
Input
A string, or a... |
This year my age is a prime number, and so is this year. This conjunction will repeat in 10 years and again in 12. If I live to 100, I will lived exactly 11 years in which my age and the year are both prime. My condolences to those of you born in odd-numbered years, who will experience this phenomenon at most once if a... |
In English, nouns can take on two different forms depending on whether they are singular (one) or plural (anything else). For example, we would say "1 dog" but "2 dogs", "0 dogs", "57 dogs" and so forth.
In Russian, there are three categories. Instead of "1 dog, 2 dogs, 5 dogs", in Russian it would be "1 собака, 2 соба... |
this challenge was based on a sandboxed post by @dmckee
Old fashioned cell phones were and are used heavily as texting platforms, unfortunately the keyboard has only 12 + a few buttons, and is therefor ill-suited to naive text entry.
Common solutions make use of the traditional telephone coding (generally with a modest... |
You may have heard of the "Hacker Logo", also called the "Hacker Emblem". It looks like this:
This is a pattern from a mathematical simulation called the Game of Life. The glider is the simplest Life pattern that moves, and the most instantly recognizable of all Life patterns.
The challenge
The challenge is pretty sim... |
This:
is a Glider.
In Conway's Game of Life, the glider is a famous pattern that rapidly traverses across the board. For today's challenge, we are going to draw an ASCII art Game of Life Board, and place a glider on it.
The board we are starting with is this:
|_|_|_|_|_|_|_|_|_|_|
|_|_|_|_|_|_|_|_|_|_|
|_|_|_|_|_|_|_|... |
Challenge
Input two integers.
Integer I/O must be decimal.
If the integers are equal, output a truthy value.
Otherwise, output a falsy value.
Clarifications
You will never receive non-integer inputs.
You will never receive an input that is outside the bounds [-2³¹, 2³¹).
Rules
Standard loopholes are disallowed.... |
Inspired by Does the start equal the end
Given a string s and an integer n, output a truthy/falsey as to whether the nth char in s equals the nth from the end char in s.
Input
A non-empty string and an integer. You can use 0-based indexing or 1-based indexing. The integer is guaranteed to be valid based on the string. ... |
Muriel is a language where the only way to loop is to create a quine and execute it. Your job is to create your own language with this property and an implementation of it in a pre-existing language.
We will define a Muriel-like language like as follows:
It has a built-in command for executing code in its own language... |
Overview
Given a 2 dimensional array of values with a filled in rectangle, find the position and size of the rectangle. Do it in the fewest array accesses as possible.
Requirements
The x and y values in the output must be 0-indexed. The top left corner is (0, 0).
The output should be the 4-tuple (x, y, width, height).... |
Dr. Trump is the head psychiatrist at a mental hospital, which is populated by murdering psychopaths. If 2 psychopaths are left together, they will end up brutally injuring or even killing each other, so Dr. Trump needs to build walls to separate these psychopaths, but owing to the limited amount of funds he has left, ... |
Your task is simple: tell me who wins the battle of the letters.
The troops
There are three different "troops" in this battle, summarized by this table.
name | health | damage
A 25 25
B 100 5
C 10 50
You may use any three unique characters to represent the the troops, but m... |
Challenge
Given an input x, create a directory (AKA folder) in the file system with the name x.
Languages that are not able to create file system directories are excluded from this challenge.
The directory may be created anywhere, as long as the location is writable to the user running the program. Assume that the prog... |
What tips do people have for golfing in TeX/LaTeX? Please post one tip per answer, each at least somewhat specific to TeX/LaTeX.
Context: I noticed this answer and that there is no tips question for TeX/LaTeX, so I'm creating this one. There's some overlap with the narrower question tips for golfing in TikZ (as TikZ i... |
Based on this challenge, you must determine if a string is covfefey, that is, could it have been produced as output from a covfefifier?
The string will be composed of only alphabet chars (^[a-z]\*$, ^[A-Z]\*$ are possible schemes for input. change the regexs appropriately if using caps)
To do this, there are a few chec... |
Writing quines is hard. Why not have your computer write them for you!
Your program will take as input an interpreter (in a Turing complete language of your choosing) for a language X, and you will output a quine in language X.
Notes:
Language X is guaranteed to be Turing complete (you do not need to check this (it wo... |
You are given a very special gun with a full magazine.
Let n be the initial number of bullets in the magazine and i the number of bullets left.
That gun is really unreliable, hence each time you shoot, you have a i/n chance to successfully shoot. The fewer bullets you have left, the more tries it requires to shoot.
The... |
Steve Ballmer is the ex-CEO of Microsoft, and in a recent article, claimed that he "still does not know what he did wrong with mobile".
As CodeProject's newsletter pointed out, "That article's title could be ended at so many spots and still be accurate".
Given no input, output the following:
Steve Ballmer still does no... |
The WannaCrypt ransomware has struck and it is attacking networks right, left and center. A network is defined by an m*n binary matrix (a), which has a a[i][j] = 1 if a computer is infected and a[i][j] = 0 if it is not. At the end of each hour, all computers that are a neighbour (which shares a side or a corner with) ... |
DONT EVALUATE YET, ALMOST FINISHED, NEED A CLEAR WINNING CRITERION
Make me rich in minecraft
Minecraft is a 3D game made of blocks that you can destroy and place. There are some interesting farms you can build to provide you with game resources. In this problem, we will only have a look at pumpkin and melons farms. Her... |
Challenge
Given a list of keys and values, and a target n, return all sets of keys where the sum of their values equals or exceeds n.
Input
Input will be like this:
[["Part 1", 20], ["Part 2", 15], ["Part 3", 14.75], ["Part 4", 3]], 30
Input consists of a list with keys (which can be any kind of string) and values (wh... |
I've always liked screens full of randomly colored pixels. They're interesting to look at and the programs that draw them are fun to watch.
The challenge
Fill your screen, or a graphical window, with colored pixels.
The rules
Your program must have an even chance of picking all colors (i.e in the range #000000 to #FFF... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.