instruction_seed stringlengths 34 53.1k | _source stringclasses 1
value |
|---|---|
The golfing language Jelly has a very complex and clever string compression system which I'm not going to go into depth about here. You can find a very good explanation here.
Basically, Jelly's string literals are represented as “...», where ... is a string of characters from Jelly's codepage that is decoded into a bas... | stackexchange_codegolf |
The species of geese known as Alex A are known for residing in triangular grids consisting of 64 cells:
(Picture taken from this unrelated Project Euler problem.)
We'll label each cell with the numbers 0 to 63 starting from the top row and then moving from left to right on each row below that. So the top cell is 0 and... | stackexchange_codegolf |
Create program that counts the total number of letters common to two names, and finds the product of their lengths, to function as a "love tester."
Conditions: you may not get a 1:1 answer (being 3 out of 3, etc.) output.
Input
Two names from STDIN or closest alternative.
Output
Compute x as the total number of letters... | stackexchange_codegolf |
Let's make a little stupid program that simulates the meme "Mr. incredible becoming uncanny", but in this case, our little ASCII friend is going to react to our code length.
Objective:
Create a program that takes anything (preferably a program) as input and outputs this:
Pov:
<face> you score X on codegolf
Where X ... | stackexchange_codegolf |
Given a non-negative integer Excel-style date code, return the corresponding "date" in any reasonable form that clearly shows year, month, and "day".
Trivial, you may think. Did you notice the "scare quotes"? I used those because Excel has some quirks. Excel counts days with number 1 for January 1st, 1900, but as if 19... | stackexchange_codegolf |
Given a non-negative integer, return the absolute difference between the sum of its even digits and the sum of its odd digits.
Default Rules
Standard Loopholes apply.
You can take input and provide output by any standard Input / Output method.
You may take input as a String, as an Integer or as a list of digits.
Th... | stackexchange_codegolf |
Inspired by this and this question
Challenge
Your challenge is to print any 100 consecutive digits of Champernowne's Constant. You must give the index at which that subsequence appears. The 0 at the beginning is not included.
For example, you could print any of the following:
+-----+------------------------------------... | stackexchange_codegolf |
(The \$\mathbb{Q}\$ in the title means rational numbers.)
Background
Conway base 13 function is an example of a strongly Darboux function, a function that takes every real number on any open interval \$(a,b)\$. In other words, for any given real numbers \$a, b, y\$, you can find a value \$x\$ between \$a\$ and \$b\$ su... | stackexchange_codegolf |
Given an array A of integers, there exists at least one positive integer p such that A[i] == A[j] for all i and j for which i % p == j % p == 0. Find the smallest p.
Examples:
Input array: [1, _, 1, _, 1, _, 1, _, 1]. Output: 2
Input array: [1, _, _, 1, _, _, 1, _, _]. Output: 3.
Input array: [1, _, _, _, 1, _, _, _, ... | stackexchange_codegolf |
Don't you hate it when you're trying to roughly sort a list based on user data, but you have to poll the user for thousands of comparisons?
Hate no more, because the answers to this challenge are (going to be) here!
Method
The sorted-ness of a list is defined by how many possible comparisons it has which are correct.
L... | stackexchange_codegolf |
Let's have a function \$f\$ that takes a string and removes all pairs of adjacent identical characters. For example
\$f(a\color{red}{bb}ba\color{red}{cc}) = aba\$
Note that when two pairs overlap we only remove one of them.
We will call a string perfectly paired if repeated application eventually yields the empty stri... | stackexchange_codegolf |
Objective
Given a nonempty unordered list of positive integers, decide whether they can be added, negated, or multiplied to yield a single zero. Each given number must be used exactly once.
There is a taboo. Do not multiply zero to anything. Adding zero to anything is OK.
Examples
Truthy
List, Solution
[1,1], 1-1
[1,1,... | stackexchange_codegolf |
We haven't had a string question for a while (5 days to be precise), so let's go for one.
Given a string s and a positive integer n, take every nth element of s, repeat it n times, and put it back into s.
For example, if n = 3 and s = "Hello, World!", every third character is Hl r!. You then repeat each character n tim... | stackexchange_codegolf |
Your challenge is to make a program(less number of bytes than what the below program takes) that should print the map of India with any special character of choice.
TIO Link
#include <stdio.h>
int main()
{
int a = 10, b = 0, c = 10;
char* str = "TFy!QJu ROo TNn(ROo)SLq SLq ULo+UHs UJq "
"TNn*RP... | stackexchange_codegolf |
The Len(language,encoding) family of languages is a variety of Lenguage derivatives. To encode a program into a Len language, you replace every character with its representation in a certain encoding, then turn that into a giant integer.
Your challenge is to write a function or program that encodes your language into a... | stackexchange_codegolf |
McCarthy's 1959 LISP
In early 1959, John McCarthy wrote a groundbreaking paper defining just nine primitive functions that when put together still form the basis for all LISP-like languages today. The paper is available digitized here:
http://www-formal.stanford.edu/jmc/recursive.pdf
Your job is to fully implement a p... | stackexchange_codegolf |
Task
Given a string composed of ASCII printable characters, return how many strings could fit the given pattern with character literals and regex-like ranges.
Pattern string
The pattern string follows this grammar (the | means an option and the * means 0 or more occurrences of whatever was immediately to the left):
pat... | stackexchange_codegolf |
Long time lurker first time poster here.
Write a program which takes 3 inputs: X, Y and Z.
X = across (columns)
Y = down (rows)
Z = Location Marker
The program should then print a visual grid X across and Y down. This grid will can be made of any character except "+". Each 'location' is given an index number, count... | stackexchange_codegolf |
You have a bunch of cities on a grid which you wish to link up. Roads can be placed on any tile that doesn't contain a city, and connect to all roads or cities adjacent to them, vertically, horizontally or diagonally.
Roads can link up via cities, for example
C
\
C-C
is fully linked up.
However, there are some moun... | stackexchange_codegolf |
The fast growing hierarchy is a way of categorizing how fast functions are growing,
defined the following way (for finite indices):
\$ f_0(n)=n+1 \$
\$ f_k(n)=f_{k-1}^n(n)\$ with \$f^n\$ meaning repeated application of the function f
Examples
f0(5) = 6
f1(3) = f0(f0(f0(3))) = 3+1+1+1= 6
f2(4) = f1(f1(f1(f1(4)))) = 2*... | stackexchange_codegolf |
Background
For my code-golf submissions in C, I need a processing tool. Like in many other languages, whitespace is mostly irrelevant in C source (but not always!) -- still makes the code much more comprehensible for humans. A fully golfed C program that doesn't contain a single redundant whitespace often is barely rea... | stackexchange_codegolf |
I have this problem where I listen to so much music that I can never remember what songs are called. But even if I remember the lyrics, I won't always know the song's name. But lucky for me, there's a pretty neat formula to determine¹ the title of a song just based on its lyrics.
I'll define the way a song title can be... | stackexchange_codegolf |
Let's say I have a .env file with the following contents:
CF_WORKERS_ACCOUNT_ID=abcdef34632114
CF_WORKERS_API_TOKEN=abcdef34632114def3463def3463
FAB_DEV_ZONE_ID=434932843272439874329
I'm doing a screencast, and I want to quickly cat .env to show what's in the file, without broadcasting the exact values, since they're ... | stackexchange_codegolf |
A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. For those who are not aware of how knights in chess work, knights are capable of moving in an L shape (see fig. 1). (Or a ߆ shape, or even a \ shape depending on who you ask.) Essentially, in one move,... | stackexchange_codegolf |
In response to here.
Unlike the previous one, this focuses on code-golf and a new logo, no longer consisting of 6 sticks and the graying-effect as the position of the sticks go deeper.
Make the Stack Overflow logo using the following criteria:
The tray:
Make a gray tray shaped like a bracket facing upwards using th... | stackexchange_codegolf |
You and a friend walk into a bar. The bartender treats you well, so you decide to tip him. So you pull out your trusty pocket computer and write a quick program to calculate a tip for you since it has no built in calculator. But wait! Your operator keys are broken! Your task is to calculate a 20% tip for any given inpu... | stackexchange_codegolf |
Background:
Take this input as an example:
1 1 2 1 1 2 1 3 1 3
If you look only at the first few digits, between 1 1 2 and 1 1 2 1 1 2 1, this input appears to consist of the pattern 1 1 2 repeating indefinitely. This would make its period 3, as there are 3 numbers in the pattern.
Given only the first number, the peri... | stackexchange_codegolf |
The Typical Way to Make an Acronym Out of a Phrase Is to Take the First Letter of Each Word: TTWMAOPITFLEW. howeveR, sometimEs, you can make an acronym of random leTters In a seNtence such As like this: RETINA. The only condition is that the letters have to be in the correct order. For instance:
LORD can be acronymise... | stackexchange_codegolf |
Given two rectangles, which are possibly not in the orthogonal direction, find the area of their intersection.
Input
You may take the rectangles as input in one of the following ways:
The coordinates of the four vertices of the rectangle. These coordinates are guaranteed to represent a rectangle.
The coordinates of t... | stackexchange_codegolf |
Congratulations, you're now a network administrator! As your first task you will need to configure a firewall to stop any traffic to some blacklisted addresses.
Unfortunately, the only firewall at your disposal only takes in rules in this format:
x.y.z.t/m ALLOW
There's no DENY keyword. If you want to exclude a specifi... | stackexchange_codegolf |
Or Fix American Kennel Club's database
As covered by the recent video by Matt Parker, the American Kennel Club permits thirty-seven (37) dogs of each breed to be assigned the same name (source), because of a database restriction for Roman numeral length.
Given an integer, your task is to output the length of its Roman ... | stackexchange_codegolf |
In Applied Cryptography by Bruce Schneier (which I have been reading quite a lot recently), a protocol for splitting secrets is discussed. Here is a brief description:
Trent generates a random byte string, R, the same length as the message, M.
Trent XORS M with R to make S.
He gives R to Alice and S to Bob.
Your ... | stackexchange_codegolf |
Given an integer \$x_1\$ and some black box function \$f: ℤ → ℤ\$ find a fixed point of \$f\$ in the sequence defined by \$x_{k+1} := f(x_k)\$.
Details
A value \$x\$ is said to be a fixed point of \$f\$ if \$x = f(x)\$.
For instance if \$f(x) = \text{round}(\frac{x}{\pi})\$ and we have a starting point \$x_1 = 10\$ t... | stackexchange_codegolf |
Challenge
Given a the ID for a PPCG user who has existed for at least a month, output the average amount of reputation they gain per month. You can do this by dividing their reputation by the time since their account was created (which you can find on the profile). This should be returned floored; that is, truncate all... | stackexchange_codegolf |
Golf Golf!
This is my first challenge, so please be gentle! The challenge is to write a program that will output the correct score for a layout in the card game "Golf."
The card game Golf has many variations. The house rules I use follow the standard rules for Six-Card Golf given by Pagat, with one slight difference. T... | stackexchange_codegolf |
The International Standard Atmosphere (ISA) is a model of the Earth's atmosphere at "reference" conditions. It includes information on pressure, temperature, and density change vs. altitude.
The ISA tabulates these properties at various layers, and an estimation of the value of interest can by found by the following pr... | stackexchange_codegolf |
Given an arbitrary sequence consisting of 1 and A
split this sequence up so that A is at the beginning of each sub sequence.
Sequences without a leading A and Sequences without 1 before the next A will be self contained.
Example
Input
111A11A1111111A1A1AA
should result in
111
A11
A1111111
A1
A1
A
A
Above already cont... | stackexchange_codegolf |
You are given 4 positive integers: volume of the first container (v1), volume of the second container (v2), volume of the liquid in the first container (l1), and volume of the liquid in the second container (l2). Your task is to move some of the liquid from container 1 to container 2, making the amount of empty space i... | stackexchange_codegolf |
Your job, for this golf, is to write a program that will take moves of a game of reversi (othello) and display the result to the user.
Input
A string of numbers taken from the range [0-7]. Each pair of numbers represent first the X coordinate, then the Y coordinate. Any characters not in that range should be ignored.
O... | stackexchange_codegolf |
You are James and four of your friends (Bjarne, Eich, Rossum, Ada) are called for an interview. There are n interviewers, and they can each serve one person at a time, alphabetically. Each round of interview takes 20 min.
Let's take n = 2,
So, the first round started with Ada and Bjarne, takes 20 min (they're handle... | stackexchange_codegolf |
Your challenge is to write a program to print all the primes (separated by one or more whitespace characters) less than a given integer N with an asterisk (*) next to each twin prime. A twin prime is a prime number that is either two more or two less than another prime.
(Hardcoding outputs is allowed, but it is not lik... | stackexchange_codegolf |
In this task, you will write a program/function that takes a Normalized Malbolge program and outputs the resulting Malbolge program. (This is a secret tool that all Malbolge programmers are using!)
Input
A data structure that (somehow) represents a Normalized Malbolge program.
Output
A data structure that represents th... | stackexchange_codegolf |
A ragged matrix, is a matrix that has a different number of elements in each row. Your challenge is to write a program in any favorable language to find the indices of all occurrences of target in the ragged matrix.
Input:
A list of ragged lists (can be empty) of positive integers and a target range e.g. 26-56. The tar... | stackexchange_codegolf |
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 ... | stackexchange_codegolf |
Introduction
Suppose you and your friend are playing a game.
Your friend thinks of some particular sequence of n bits, and your task is to deduce the sequence by asking them questions.
However, the only type of question you're allowed to ask is "How long is the longest common subsequence of your sequence and S", where ... | stackexchange_codegolf |
Background
For the purposes of this challenge, we'll define a "perfect nontransitive set" to be a set \$A\$ with some irreflexive, antisymmetric relation \$<\$, such that for all \$a \in A\$ we have that \$|\{x \in A|x<a\}|=|\{x \in A|x>a\}|\$.
Okay, now in layperson's terms: \$A\$ is a set of elements with no duplicat... | stackexchange_codegolf |
This is a cross-post of a problem I posted to anarchy golf: http://golf.shinh.org/p.rb?tails
Given two integers \$ n \$ and \$ k \$ \$ (0 \le k \le n) \$, count the number of combinations of \$ n \$ coin tosses with at least \$ k \$ tails in a row.
For example, if \$ n = 3 \$ and \$ k = 2 \$, the answer is \$ 3 \$:
HHH... | stackexchange_codegolf |
This challenge takes place on a grid.
+----------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
+----------+
This one's 10 x 10, but it can be any rectangular shape.
There are four directions on this grid. Up, down, left and right.
The task is to ... | stackexchange_codegolf |
Rip-off of a rip-off of a rip-off of a rip-off. Go upvote those!
Your task, if you wish to accept it, is to write a program/function that outputs/returns its input/argument¹. The tricky part is that if I transpose your source code², the output/result must be transposed too.
You may choose which kind of 2D data your so... | stackexchange_codegolf |
There is a job which can be decomposed into x equally-sized smaller tasks. You have a team of size y <= x, where every member works equally fast on any task. The goal for this challenge is to divide the work as evenly as possible such that every member of your team has at least 1 task to perform. As evenly as possible ... | stackexchange_codegolf |
Introduction
In many programming languages, within syntax exceptions, it is often pointed out to the programmer exactly which character or line is the culprit. This challenge will be a bit of a modification of that - specifically, using an arrow to point out any specific character of an input string.
The challenge
Your... | stackexchange_codegolf |
As stated, write a program that is capable to, in an automated manner, write more code and another program and execute that program from itself.
In short, you are asked to write a program that can write another self-standing program itself and enable it to execute in any function.
Do this in the shortest amount of cod... | stackexchange_codegolf |
AKA: Generate Clickbait From an Array.
Given an array of integers, generate some cringe-worthy clickbait based on its arrangement and length:
If it's 20 elements or less, you can make a Top X List. Parameters: length of the array.
Prime numbers are celebrities, so anytime two of them are next to each other it'll pass ... | stackexchange_codegolf |
This includes tips for all related derivatives, as coding in these langs often primarily consists of writing the function in the lambda calculus and then compiling it down at the end.
Among others, this includes tips for:
Standard combinator calculi
SKI system
BCKW system
Esolang combinator calculi
Iota/Jot/Zot
La... | stackexchange_codegolf |
Challenge: Find the number of distinct words in a sentence
Your task is to write a program that takes a sentence as input and returns the number of distinct words in it. For this challenge, words are defined as consecutive sequences of letters, digits, and underscores ('_').
Input:
A string containing a sentence. The ... | stackexchange_codegolf |
So, normally, this is a forbidden loophole to fetch the desired output from an external source. But this challenge is an exception ! In this challenge you will have to fetch data from the internet and output it to the SDTOUT.
The task
For the purpose of this challenge, you'll be the owner of the imaginary a.pi domain!... | stackexchange_codegolf |
A binary eye is an odd set of digits, with all of its digits except the center one set to 1 or 0, and the center one set to the opposite of the others. Thus, there are two binary eyes for a given odd number of digits:
x
eyes
1
1,0
3
101,010
5
11011,00100
7
1110111,0001000
9
111101111,000010000
Make ... | stackexchange_codegolf |
Task
The letters spell out actual words, but if you replace each letter with a digit from 0–9, it also “spells” an arithmetic equation. The trick is to figure out which letter maps to each digit. All the occurrences of each letter must map to the same digit, no digit can be repeated, and no “word” can start with the di... | stackexchange_codegolf |
A "simple circular" word is a word whose chords do not intersect. The chords of a word may be seen by laying out the alphabet in a circle, and then connecting the word's consecutive letters.
Examples of Simple Circular Words
ROLE
LAKE
BALMY
Failing Example
A word fails to be simple circular if any of its chords in... | stackexchange_codegolf |
Your challenge is very simple: output the previous answer, in reverse.
However, as with this similarly-titled question, there's a catch: in this case, you can only use characters from the answer before the last. For example:
Let's say the first answer looks like this:
1 - Python
print('hi!')
And the second answer loo... | stackexchange_codegolf |
Your task, should you choose to accept it, is to take two input values \$a\$ and \$b\$,
where \$a\$ and \$b\$ are in the set \$\{T, U, F\}\$, and compute and output their logical conjunction in a three-valued logic system.
A three valued logical conjunction is this transformation:
a
b
output
U
U
U
U
F
F
F
... | stackexchange_codegolf |
I like to pretty print multidimensional arrays, like this:
[ [ [1, 2, 3],
[4, 5, 6] ],
[ [7, 8, 9],
[6, 4, 2] ] ]
But it's a pain to do by hand and it'd be nice to have a program that does this for me. Your challenge is to create a program that does this for me, taking a multidimensional array containing onl... | stackexchange_codegolf |
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... | stackexchange_codegolf |
This 128-language quine ouroboros (a program which outputs a program in another language, which outputs a program in yet another language, (125 languages later), which outputs the original program) is pretty impressive. But unfortunately, it has a static number of iterations.
Write a program which outputs a program (no... | stackexchange_codegolf |
You have a little robot with four distance sensors. It knows the layout of a room, but it has no sense of orientation other than being able to lock onto the grid orientation. You want to be able to find out where the robot is based on the readings, but it can be ambiguous because of the limited sensors.
Challenge Expla... | stackexchange_codegolf |
Your challenge is to query the SE API and find out whose rep on PPCG is tied, and output it. If these were all the users on PPCG:
Martin Ender: 10000 rep
Dennis: 10000 rep
xnor: 5000 rep
sp3000: 3000 rep
You should output Martin Ender, Dennis. If these were the only users:
Jon Skeet: 1000000 rep
Martin Ender: 10000 re... | stackexchange_codegolf |
Your task is to automatically complete URLs like the address bar in most browsers is doing. We will use the following (simplified) rules:
If the input string starts with http://, ftp:// or https://, return the string unchanged.
Otherwise, if the input string contains a dot ., e.g. in.put then the HTTP is assumed and ... | stackexchange_codegolf |
\$\left\{ n \atop k \right\}\$ or \$S(n, k)\$ is a way of referring to the Stirling numbers of the second kind, the number of ways to partition a set of \$n\$ items into \$k\$ non-empty subsets. For example, to partition \$\{1,2,3,4\}\$ into \$2\$ non-empty subsets, we have
$$\begin{matrix}
\{\{1\},\{2,3,4\}\} & \{\{2\... | stackexchange_codegolf |
A constructible \$n\$-gon is a regular polygon with n sides that you can construct with only a compass and an unmarked ruler.
As stated by Gauss, the only \$n\$ for which a \$n\$-gon is constructible is a product of any number of distinct Fermat primes and a power of \$2\$ (ie. \$n = 2^k \times p_1 \times p_2 \times ..... | stackexchange_codegolf |
UTF-1 is one of the methods to transform ISO/IEC 10646 and Unicode into a sequence of bytes. It was originally for ISO 10646.
The UTF-1 encodes every character with variable length of byte sequence, just like UTF-8 does. It was designed to avoid control codes. But it was not designed to avoid duplication of a slash cha... | stackexchange_codegolf |
The plus-minus sequence
The plus-minus sequence is one that starts with two seeds, a(0) and b(0). Each iteration of this sequence is the addition and subtraction of the previous two members of the sequence. That is, a(N) = a(N-1) + b(N-1) and b(N) = a(N-1) - b(N-1).
Objective Produce the plus-minus sequence, in infinit... | stackexchange_codegolf |
Part of Code Golf Advent Calendar 2022 event. See the linked meta post for details.
Santa has a bunch of presents wrapped in cuboid boxes of various sizes. As his sled flies above a chimney, a stack of presents will be automatically dropped through it. Santa wants to carefully choose the presents so that all of them f... | stackexchange_codegolf |
You are tasked with displaying the string "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and only that, except for trailing newlines if they're unavoidable.
You must not output any homoglyphic characters like Cyrillic A. You can use non-Unicode encodings, but just to be sure, only output the Latin letters.
Regardless of the encoding you... | stackexchange_codegolf |
The string
abaaba
Is a palindrome, meaning it doesn't change when it's reversed. However we can split it in half to make two palindromes
aba aba
We could also split it up this way:
a baab a
And all three of those are palindromes.
In fact there are only two ways to split the string into smaller strings such that non... | stackexchange_codegolf |
Inspired by Greg Martin's "Shiny cryptarithm" puzzle.
A cryptarithm is a game consisting of a mathematical equation among unknown numbers, whose digits are represented by letters of the alphabet. The goal is to identify the value of each letter. They are usually represented by an addition operation, such as SEND + MORE... | stackexchange_codegolf |
Related: Ellipse circumference
Introduction
An ellipsoid (Wikipedia / MathWorld) is a 3D object analogous to an ellipse on 2D. Its shape is defined by three principal semi-axes \$a,b,c\$:
$$ \frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} = 1 $$
Just like an ellipse, the volume of an ellipsoid is easy, but its surf... | stackexchange_codegolf |
Very related
You're given a piece of ASCII art representing a piece of land, like so:
/‾\
__/ ‾\_
\_/‾\
\
Since an overline (‾) is not ASCII, you can use a ~ or - instead.
Your challenge is to determine if it is connected by the lines of the characters. For example, the above can be traced ... | stackexchange_codegolf |
Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day.
Rules:
No using input or showing output through the usual IO methods, except to print to STDERR or your language's equivalent. You ... | stackexchange_codegolf |
My user id is 106959
How to check if the number is Fmbalbuena number?
First Step: Check if the number of digits is a multiple of 3: 6 = 3 * 2
Second step: Split the digits into even thirds: 106959 -> 10 69 59
Third step: Subtract the first set of digits from the second modulo 10: 6 - 1 = 5, 9 - 0 = 9
Last step: Check t... | stackexchange_codegolf |
Doing my history reading and note-taking, I can't help but get tired of writing out all these long dates –– 1784 is six entire pencil lifts! jǝǝz!
As you can see, I –– like most challenge posters on this site –– am lazy when it comes to writing stuff. Thus, I ask you to please help me shorten some dates. Of course, you... | stackexchange_codegolf |
This is my attempt to pair code-shuffleboard with code-golf.
You need to write a full program or function that sums all codepoints of the input string. If there is no input, you can output any number, including 0.
Rules
The input will always be in printable ASCII.
The sum of the codepoints of your source must be exact... | stackexchange_codegolf |
This is the robbers' thread. The cops' thread is located here.
Robber rules
Should work for all keys and secrets
Should require the same number or fewer guesses as the cop's fault, to prevent brute forcing
Does not need to be the same as the cop's intended fault
Multiple cracks may be made for the same cop, as long as... | stackexchange_codegolf |
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... | stackexchange_codegolf |
Background
A backronym is an acronym that was formed from an existing word. For example, spam is actually named after the canned meat product as used in the Monty Python sketch, but can be interpreted as "stupid pointless annoying mail".
Challenge
Given a string a, and a word t, capitalise the correct letters of the w... | stackexchange_codegolf |
Challenge
Write code that outputs TeX (LaTeX) math-equation code (given below) that will typeset Sierpinski Triangle Fractal of 5 levels. Shortest code wins.
Details
TeX (and friends like LaTeX, etc.) is a sophisticated typesetting system. It can render arbitrary nested complex expressions for mathematical formulas. Co... | stackexchange_codegolf |
Cyclic Polyglot Challenge
This is the cops thread. You can find the robbers thread here.
Cyclic Polyglot
A N-element cyclic polyglot is a complete program that can be run in N different languages. In each language, when the program is run with no input (possibly subject to this exception), it should print the name of a... | stackexchange_codegolf |
The barbells at my gym look like this:
=========[]-----------------------[]=========
They can hold plates of five different sizes, 2.5 pounds, five pounds, ten pounds, 25 pounds, and 45 pounds:
.
. ! |
. ! | | |
| | | | |
' ! | | |
' ! |
'... | stackexchange_codegolf |
In this challenge, you will write a program to output how many decimal places are in the input string and trim the input if needed.
Examples
-12.32
2
32
0
3231.432
3
-34.0
0 -34
023
0 23
00324.230
2 324.23
10
0
00.3
1 0.3
0
0
-04.8330
3 -4.833
Rules
Input will be a string which can be taken through, STDIN, f... | stackexchange_codegolf |
The task is to write a radiation-hardened irradiator. What do I mean by that, exactly?
An irradiator is a program that, when given a string as input, will output all possible versions of the string with one character removed. For example, given the input Hello, world!, the program should output:
ello, world!
Hllo, worl... | stackexchange_codegolf |
Consider compass-and-straightedge construction, where you can construct new points from existing ones by examining intersections of straight lines and circles constructed with one of the following two options:
Draw the unique infinitely long straight line passing through points \$(x, y)\$ and \$(x', y')\$
Draw the uni... | stackexchange_codegolf |
Create quine variant such that the program prints its first character, then the first two, then three and so on until the whole program is printed.
Example
Suppose your code is @@@@@2 in some language. Then the output should be
@
@@
@@@
@@@@
@@@@@
@@@@@2
in that order, each line separated by a newline.
The winner is t... | stackexchange_codegolf |
A Sophie Germain Prime is a prime number P such that 2P+1 is prime as well. Given a prime number as input, your task is to determine whether it is a Sophie Germain Prime.
Standard Input/Output rules and Default Loopholes apply.
This is a decision-problem, so standard rules for this tag apply (returning two distinct and... | stackexchange_codegolf |
Create a function which takes a polynomial equation, a value for x and returns the result of the operation.
Example: given 4x^2+2x-5 and x=3 output 37. This is the result of 4(3)^2+2(3)-5
Assume all polynomials are valid
Polynomial format will always be coefficient(variable)^exponent => 4x^2 except :
When exponent ... | stackexchange_codegolf |
Today is Bacon Day which is probably why the name of the hat for participating today is "Mmmm Bacon". What better way to celebrate bacon day with fun filled 2d matrices made out of bacon! A 1 by 1 bacon strip is represented by this:
-----
)===)
(===(
)===)
-----
You goal here is given two coordinates in a tuple, (x,... | stackexchange_codegolf |
You will create a program that generates the stereographic projection of polyhedra.
In particular, to keep things simple, we'll only focus on n-chamfered dodecahedron.
Given a natural number n as input, and also a natural number d your program will output an d pixels by d pixels image which is the stereographic project... | stackexchange_codegolf |
Sometimes to fall asleep, I'll count as high as I can, whilst skipping numbers that are not square-free. I get a little thrill when I get to skip over several numbers in a row - for example, 48,49,50 are all NOT square-free (48 is divisible by 2^2, 49 by 7^2, and 50 by 5^2).
This led me to wondering about the earliest ... | stackexchange_codegolf |
The dealer has been sloppy and lost track of what cards his/her deck contains and what cards are missing, can you help him/her?
A complete deck consists of 52 playing cards, namely:
Each color in the deck (hearts, diamonds, spades, clubs) contains:
The numbers [2 - 10]
A Jack
A Queen
A King
An Ace
Task
Your program... | stackexchange_codegolf |
<< Prev Next >>
Santa was able to remanufacture all of the presents that the elves stole overnight! Now he has to send them to the assembly line for packaging. He usually has a camera to supervise the assembly line both to make sure the elves are doing a good job and because assembly line pictures look nice on advertis... | stackexchange_codegolf |
This is a somewhat proof-golf-like cops-and-robbers challenge. This is the cops' thread; the robbers' thread is here.
Cops
Your task is to define an abstract rewriting system in which the reachability of one word from another is difficult to determine. You will prepare the following things:
A set of symbols, called th... | stackexchange_codegolf |
This is my first time here at Code Golf SE so feel free to add your input/advice/suggestions to improve my post if necessary. The week after my computer science exam, the solutions were publicly published. One problem had a 45 line example solution but my solution was only 18 lines, (which I was very proud of), but I b... | stackexchange_codegolf |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.