Code Golf Stack Exchange Community Digest

Top new questions this week:

Swap Two Values in a List

Introduction: Although we have a lot of challenges where swapping two items in a list is a subtask, like Single swaps of an array; Swap to Sort an Array; \$n\$ swaps into a nop; etc., we don't have ...

code-golf number array-manipulation integer  
asked by Kevin Cruijssen 17 votes
answered by Wheat Witch 7 votes

How many values of this type?

Background The number of values for a given type is called the cardinality of that type, and that of type T is written as |T|. Haskell and a few other languages ...

code-golf string math parsing  
asked by Bubbler 15 votes
answered by hyper-neutrino 15 votes

Maybe fractal sequence?

Background A fractal sequence (Wikipedia; MathWorld) is an infinite sequence of positive integers meeting the following conditions: Each positive integer appears infinitely many times in the sequence....

code-golf sequence decision-problem integer  
asked by Bubbler 13 votes
answered by frasiyav 5 votes

(t)h(e)(i)(r)(m)

Sometimes authors will write (s)he as a stand in for she or he and for some reason they don'...

code-golf string  
asked by Wheat Witch 11 votes

Lean golf: List Game Lv1 (rev_rev)

The title is an homage of the Natural Number Game, which is a nice interactive tutorial into proving certain properties of natural numbers in Lean. Given that the previous two were slightly too ...

code-golf lean  
asked by Bubbler 10 votes
answered by Wheat Witch 9 votes

Iterative Quine

Create a program which prints itself, followed by an additional program. This additional program should print the first program, itself, and then a third program. This continues until the nth program, ...

code-challenge quine code-generation  
asked by thejonymyster 9 votes
answered by Conor O'Brien 8 votes

Lean golf: List Game Lv2 (is_in_append, is_in_rev)

The title is an homage of the Natural Number Game, which is a nice interactive tutorial into proving certain properties of natural numbers in Lean. The definitions used in Lv1 will be reused here. I'...

code-golf lean  
asked by Bubbler 9 votes
answered by Anders Kaseorg 9 votes

Greatest hits from previous weeks:

Tips for golfing in JavaScript

What general tips do you have for golfing in JavaScript? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to JavaScript (e.g. "remove ...

code-golf tips javascript  
asked by mellamokb 156 votes
answered by zzzzBov 123 votes

Google's doodle on kids coding: shortest program solving all the levels

Today's Google doodle is about Celebrating 50 years of Kids Coding: The goal is program the path of a little bunny so that it can eat all the carrots. There are 4 types of blocks (see pictures below): ...

game atomic-code-golf  
asked by Surb 32 votes
answered by Reinis Mazeiks 29 votes

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Hold up..... this isn't trolling. Background These days on YouTube, comment sections are littered with such patterns: ...

code-golf string ascii-art  
asked by Arjun 97 votes
answered by Nitrodon 113 votes

Is this number a prime?

Believe it or not, we do not yet have a code golf challenge for a simple primality test. While it may not be the most interesting challenge, particularly for "usual" languages, it can be nontrivial in ...

code-golf number number-theory primes decision-problem  
asked by Dennis 221 votes
answered by histocrat 249 votes

Leak Memory in as few bytes as possible

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 ...

code-golf  
asked by Wheat Witch 85 votes
answered by Riley 66 votes

1, 2, Fizz, 4, Buzz

Introduction In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other ...

code-golf string kolmogorov-complexity arithmetic fizzbuzz  
asked by Beta Decay 175 votes
answered by M L 101 votes

Print the last, middle and first character of your code

The challenge is simple: Print the last, middle, and first character of your program's source code, in that order. The middle character is defined as follows, assuming a source length of ...

code-golf quine  
asked by bigyihsuan 65 votes
answered by Oliver 187 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