Code Golf Stack Exchange Community Digest

Top new questions this week:

R.E.P.A.I.R. T.H.E. K.E.Y.B.O.A.R.D

Sequel of this AWESOME challenge You, a genius tech prodigy detective, have successfully disarmed the bomb and want to break into the computer. The police found the password ...

string code-challenge restricted-source  
asked by Wasif 27 votes
answered by hyper-neutrino 18 votes

Output a Latin Square

An \$n\times n\$ Latin Square is a grid containing exactly \$n\$ distinct values where the values in each row and column are distinct. For example, $$\begin{matrix} A & B & C \\ C & A &...

code-golf array-manipulation matrix  
asked by caird coinheringaahing 22 votes
answered by dingledooper 16 votes

How many bystanders will help?

Flavortext The Bystander Effect is a phenomenon where individuals are less likely to help a victim if other people are present. The idea is that as there are more people around, the individual burden ...

code-golf math array-manipulation  
asked by hyper-neutrino 22 votes
answered by Jonathan Allan 12 votes

Calculate Home Primes

The Home Prime of an integer \$n\$ is the value obtained by repeatedly factoring and concatenating \$n\$'s prime factors (in ascending order, including repeats) until reaching a fixed point (a prime). ...

code-golf math number-theory primes  
asked by caird coinheringaahing 22 votes
answered by ovs 12 votes

Make it prime with the smallest suffix

Given a positive integer as input, output the smallest positive integer such that appending its digits (in base 10) to the end of the input number will form a prime number. Examples ...

code-golf primes  
asked by Beefster 20 votes
answered by caird coinheringaahing 9 votes

Close neighbours stick together

Given a list of positive digits, return that list with consecutive elements grouped together. For example: ...

code-golf array-manipulation  
asked by caird coinheringaahing 19 votes
answered by Jonah 9 votes

The half-step of Fibonacci

Challenge Implement the 1-indexed sequence A054049, which starts like this: ...

code-golf math sequence fibonacci  
asked by Bubbler 19 votes
answered by hyper-neutrino 11 votes

Greatest hits from previous weeks:

How can I use cmp(a,b) with Python3?

I was told that using the cmp function can be very useful in code-golf. But unfortunately, Python 3 doesn't have a cmp function. ...

code-golf tips python  
asked by xaxa 16 votes
answered by xnor 35 votes

Implement the Thanos sorting algorithm

The sorting algorithm goes like this: While the list is not sorted, snap half of all items (remove them from the list). Continue until the list is sorted or only one item remains (which is sorted by ...

code-golf sorting  
asked by vrwim 96 votes
answered by Sara J 19 votes

Polygon prefixes

Polygons are named after the number of sides that they have. A pentagon has 5 sides, an octagon has 8 sides. But how are they named? What's the name for a 248-sided polygon? All polygons are suffixed ...

code-golf geometry  
asked by beary605 17 votes
answered by baby-rabbit 5 votes

Print every character your program doesn't have

Your task is to build a program (using only printable ASCII characters and/or tabs and newlines) that prints out exactly the characters in the printable ASCII space (...

code-golf self-referential  
asked by Joe Z. 222 votes
answered by Howard 55 votes

American Gothic in the palette of Mona Lisa: Rearrange the pixels

You are given two true color images, the Source and the Palette. They do not necessarily have the same dimensions but it is guaranteed that their areas are the same, i.e. they have the same number of ...

popularity-contest graphical-output image-processing color  
asked by Calvin's Hobbies 380 votes
answered by aditsu quit because SE is EVIL 161 votes

Hard code golf: Regex for divisibility by 7

Matthias Goergens has a 25,604-character (down from the original 63,993-character) regex to match numbers divisible by 7, but that includes a lot of fluff: redundant parentheses, distribution (...

code-golf math regular-expression  
asked by Charles 77 votes

"Hello, World!"

So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most ...

code-golf string kolmogorov-complexity hello-world  
asked by Martin Ender 466 votes
answered by Fatalize 487 votes

Can you answer this question?

Golfing Expressions

We can write mathematical expressions using the standard math operators (,),+,...

string parsing polynomials test-battery expression-building  
asked by Jay 9 votes
You're receiving this message because you subscribed to the Code Golf community digest.
Unsubscribe from this community digest       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 110 William Street, 28th floor, New York, NY 10038

<3