14
votes
\$\begingroup\$

Final phase

You have chosen the categories and the nominees for CGCC's annual "Best of". Now it is time to pick the winners!

Each of the 16 categories is represented by an answer to this question, and each of these answers contains all nominations by the members of our community.

Voting mechanism

Each nominee has been added as a comment to its category's answer. In each category, the nominee whose comment has the highest number of votes by Feb 21 13:00 UTC will be declared the winner of that category.

Further details

  • Starting now, please do not edit the answers.

  • Please do not add comments to the answers.

  • Votes on the question and on answers are meaningless; only votes on comments count.

  • Feel free to vote for multiple nominees of the same category, including your own posts.

\$\endgroup\$
0

16 Answers 16

6
votes
\$\begingroup\$

Most diverse challenge

Often, there is one real algorithm to solve a challenge that is competetive. Maybe very esoteric or specialized languages need a different approach, but mostly, every answer is just a translation of the others.

This award is for challenges with no clear single approach where very different algorithms can be competitive. These are the most fun to solve, since you can't just translate other answers but need to carefully consider which approach to take, or even to invent a new one.

This prize is intended specifically for:

Challenges where:

  • There are either many approaches or just a few that are very different
  • All of which are competitive
  • Even in the same/similar languages

The second even sublime number by Bubbler

Self-nomination

There are two main approaches (brute-force and hardcode) and, due to the nature of the number in question, it allows quite a few variations on the hardcoded solution. Both hardcode and bruteforce turned out to be competitive in Jelly and Vyxal.

Build a list from a depth map by Wheat Wizard

nominated by emanresu A

With this challenge there were two main approaches: Manipulating the input as a string, or handling it as a list of nested lists and carefully flattening them. Both were fairly competitive and there were several variations on each.

Derivative of a product by emanresu A

self-nomination

For such a simple string-manipulation challenge, this had multiple fairly competitive approaches:

Create Bernard from Desmos by Aiden Chow

Self-nomination

Even though the challenge simply asks to output a straightforward pattern of 0's and 1's, there are a plethora of different strategies that could be implemented. Some answers implemented their solutions based on the procedure described in the challenge, some even copying the procedure step-by-step, while others came up with ingenious tricks with binary and base conversions to make their code even golfier. One amazing answer with an assortment of interesting tricks and tidbits was even written in Desmos, the language/graphing calculator that the challenge was inspired by!

\$\endgroup\$
4
4
votes
\$\begingroup\$

Most significant impact via Meta

Repost from 2021

Meta is an important yet often overlooked portion of this site, where significant rules changes are decided, and the site becomes the most democratic. It allows people to present their visions of the site, and for others to show their agreement or disagreement, and contributions can be just as important - if not more - than posts on Main.

This category is to reward Meta posts that have had a non-trivial or significant impact on the site in some way, and the users who proposed them.

What is our consensus for fractional byte functions? by Radvylf Programs

nominated by emanresu A

Until recently, no matter what encoding languages used, they had to round their score up to the nearest full byte. This meant that fractional-byte golflangs were substantially disadvantaged. This question ultimately resulted in fractional bytes always being allowed, paving the way for many fractional-byte golflangs and allowing older languages like 7 to finally have a fair chance.

Announcing Code Golf Advent Calendar 2022! (+ Event challenge sandbox) by Bubbler

nominated by emanresu A

After a name change for legal reasons, Advent of Code Golf is back!

While this event included more community participation, Bubbler still had to coordinate eight peoples' posting schedules, an extremely impressive feat. Additionally, they created sixteen of the challenges in just a month.

Overall, this event created 24 high-quality challenges, over 3% of the total challenges posted that year.

\$\endgroup\$
2
4
votes
\$\begingroup\$

Breaking The Mold (Most Original Challenge)

Reposted from 2021, 2018

It's really easy to come up with normal and , or challenge, etc. Don't get me wrong, there's nothing wrong with these challenges. They're the meat of the challenges on our site. However, they're not the most imaginative.

This category is for a challenge that re-invents the wheel, and explores new ideas that we haven't really used on the site.

  • Maybe this challenge inspired a new tag, or category of challenges?

  • Maybe it's a with a unique and very well balanced scoring formula?

Or maybe it's even a challenge about a novel task. This category is for rewarding users who came up with interesting ideas that keep the site fresh.

Some justification for why the challenge is original is necessary with nominations - 99% of challenges posted on the site shouldn't qualify for this.

50 digits of π in HQ0-9+-INCOMPUTABLE? by Bubbler

Self-nomination

We have challenges already, but the languages in question often have the usual building blocks, such as small constants, arithmetic, and loops (though they can be sometimes extremely minimalistic). I believe this challenge is special in that you only have the weirdest kinds of building blocks instead, and need to figure out some unique ways to approach the desired output. And indeed, some users have found ways to utilize different sets of commands that led to shockingly short solutions.

Radiation Hardening KOTH by Mousetail

Self-nomination

This challenge combines many of our favorite generes of this site, KOTH since you want to beat other players, golfing since your bot needs to fit the 255 byte limit and still be sufficiently redundant, radiation hardening to make it resistant against attacks, and even quasi-polyglotting as competitors try to disguise themselves as a different language.

Add a hidden language to a polyglot by emanresu A

self-nomination

This challenge combines , and in an interesting combination, where people have to carefully add another language to a polyglot without being too obvious about what that language is. It included some clever solutions, including a HQ9+ derivative being useful for once and not modifying the code at all.

\$\endgroup\$
3
4
votes
\$\begingroup\$

Most helpful Sandbox commenter

Repost from 2021.

The Sandbox is a very useful tool to help improve people's challenges, and functions best when users provide helpful advice and feedback on the drafts.

This category should reward the users who helped the most in the Sandbox during 2022.

pajonk

self-nomination

I browse Sandbox quite frequently and try to spot problems with questions that may arise on the main site. Mostly under- or over-specified I/O, ambiguities in the description or issues with scoring. I also try to give my thoughts on questions in the meta section of the challenge.

This SEDE query seems to back up this nomination, but bear in mind that this doesn't include deleted posts (does it?) and feedback given in the TNB chatroom.

\$\endgroup\$
1
3
votes
\$\begingroup\$

Kansas City Shuffle

Reposted from 2021 2018 2017 2016

Too often, someone devises a particularly golfy method of solving a challenge, which most people will use that method for their answers. This award goes to those answers that utilize an alternative method as a better solution than the method that the majority of other answers use (prior to the posting of the rewarded answer).

Is this graph a tree? by Alex

nominated by alephalpha

I did not specify the input format for this challenge. Most answers used conventional graph formats like edge lists, adjacency lists or adjacency matrices. Alex used a format that I never would have thought of: the oriented incidence matrix, and solved the challenge in only 4 bytes.

\$\endgroup\$
1
3
votes
\$\begingroup\$

Best tip

Repost from 2021, 2020, 2019, 2017, 2016

For the best answer to a question tagged with , because this site isn't just about competing with one another, but also about helping each other improve our golfing skills.

Better way to read multiple int in C than scanf by Mousetail and DialFrost

Partial Self-nomination by Mousetail

This question was unsolved for 5 years, till DialFrost and I finally found a way to shorten it, saves 1 byte in the example case and 6 bytes when reading 5 variables.

0in instead of not all in Python by pxeger

nominated by emanresu A

You'd think any and all are very short function names, and they'd be the shortest way to check if any/all elements of an array are truthy, right?

Wrong. This tip abuses type coercion and operator whitespace to allow saving several bytes on what is a quite common operation in Python, making it very widely applicable and useful. It also provides a tip for a much rarer case of something similar.

Use - as a check for recursive functions in Vyxal by emanresu A

self-nomination

Writing a recursive function that behaves differently on lists and non-lists comes up fairly often, especially in challenges. This uses a clever trick where running a dyadic operation on two copies of the same scalar value gives a falsy value, but that operation returns a truthy result on lists due to any non-empty list being truthy.

This does have the caveat of not working on empty lists, but the answer also provides a 2-byte alternative for that case.

Use ++ in patterns in Curry by Wheat Wizard

Nominated by DLosc

Curry, at first glance, looks a lot like Haskell, but Wheat Wizard's tip showcases an example where Curry can do something Haskell can't. Pattern-matching using ++ is a very powerful ability that I've seen used in multiple Curry answers.

Basic routing and halting in Piet by Bubbler

Nominated by DLosc

Control flow in Piet is hard to understand. Even figuring out how to halt the program is non-trivial! Bubbler gives a golf-oriented tutorial that lays out how control flow works and how to use that knowledge to construct different kinds of loops. Helpful diagrams accompany the explanation--particularly useful, given how counterintuitive the pointer movement logic can be.

Abuse builtins for type-checking in tinylisp by DLosc

Self-nomination

The builtins in tinylisp are mostly one byte each, but one of the ones that isn't is type. It also, unfortunately for golf, returns multi-character names like Int or List. As such, checking the type of an expression (for instance, distinguishing between lists and integers in challenges) can be expensive. I found a number of hacky ways to use other builtins to distinguish between types at a much lower byte cost.

\$\endgroup\$
6
3
votes
\$\begingroup\$

Best mathematical insight

Repost of 2021, 2020, 2019, 2018.

On this site we often see answers in languages specifically designed for short code, or designed to be fast. Sometimes, a nice golfing trick or speed-up technique surprises us with its ingenuity, beyond the standard use of that language.

And occasionally an answer shows up that uses an unexpected approach to greatly simplify the problem, and makes us wonder how the author could ever think of that. This usually involves some far-from-obvious mathematical equivalence, or a particularly simple approach to the problem that was not evident at all (once revealed, other answers often follow the same approach).

This category is for the answer with the best mathematical insight or unexpected approach that led to greatly simplifying the problem, in any challenge type (code golf, fastest code, or others). The insight should have led to a significant improvement according to the challenge's metric (code length, run time, or whatever applicable).

Average-ignorant sets of integers by allxy

nominated by emanresu A (self-nomination-ish)

This answer changed a complex set-building question into a simple base conversion problem, and provided a 4-byte Jelly answer which is still unbeaten. Every answer following this used the same approach, or a variant of it, with most answers porting that answer or the later posted python answer.

The answer also includes the thought process of finding that definition, starting from a greedy approach and using OEIS to find alternate definitions.

Rolling a ball over a list by tsh

nominated by alephalpha

Tsh found a simple and elegant formula for this complex challenge about 1D cellular automata. It was ported by most of the other answers.

Tsh did not prove the correctness of the answer. A detailed proof can be found in Jonah's answer.

Exponential transform of an integer sequence by Command Master

nominated by alephalpha

This is a purely algebraic challenge about transforming integer sequences. Command Master found a combinatorial interpretation of the problem, and solved it using 05AB1E's list operations. The resulting code did not contain any math operations, but the mathematical insight was really impressive.

The answer also includes a detailed explanation and proof.

Enumerate the set of all sets by Pxeger

Nominated by Mousetail

Enumerating all sets seems like it would take a good amount of code. However, the very first answer finds a very short recursive approach based on converting sets to binary numbers, a very unexpected direction. The explanation is really good too. Basically every answer afterwards copies this approach.

\$\endgroup\$
6
3
votes
\$\begingroup\$

Wrong tool for the job

Repost from 2018, 2021

This category is for an answers that use the worst possible language to accomplish a task, while still making an effort to optimize the score. For example, writing a non-trivial program while using an extremely minimalist language like 7, or an inconvenient language like lost, or even a normal language that's missing some crucial capability like internet connectivity or image processing.

Answers for this category should consider both the difficulty of the task and the unsuitable-ness of the language.

Ungolf my tinylisp code in tinylisp by emanresu A

self-nomination

Lisp is an elegant language, but it's not at all built for string manipulation. tinylisp is a minimal dialect of Lisp with only seven builtins, and it doesn't even have a proper string datatype. The challenge here is to pretty-print a piece of tinylisp code, requiring extensive string parsing, yet this answer does it in tinylisp, coming in at only three times the size of the other answers!

Additionally, the code is extremely optimised and makes heavy use of tail calls, so it can actually run all the test cases in reasonable time - despite operations like concatenating strings being O(n^2).

Draw this fractal generated by applying Newton's method to cosh(x) - 1 in Desmos by MathEnthusiast314

nominated by emanresu A

Seeing this challenge, you might think that a graphing calculator like Desmos would be the perfect language. It's really not.

While Desmos has easy access to mathematical functions like cosh, the challenge requires iteration and approximation, two things Desmos can't do very easily. Yet despite these limits, the answer comes in at 353 bytes, beating the example Python answer and producing an extremely laggy graph.

Crossing a Lily Pond in BitCycle by des54321

nominated by Kevin Cruijssen

Although it also fits the Rookie of the Year - Answers category, since it's one of des54321's first answers, I think it better fits here. Aiden Chow joked in chat that the input being a string of bits is perfect for BitCycle, but des54321 took this as a challenge and actually did it.

\$\endgroup\$
3
3
votes
\$\begingroup\$

Best non-text answer

There are a few "languages" here that are allowed to compete, but do not have a textual representation in their native form. Examples are Piet, Scratch, The Powder Toy, and even Minecraft redstone. For most of these, we have found ways to convert them to the byte-based representation we all know and love. For the above, respectively, they are ASCII-Piet, scratchblocks , TPT save files, and structure files. This prize will go to the best answer in a language that does not have a textual representation natively.

1, 2, Fizz, 4, Buzz in Apple Shortcuts by Aaroneous Miller

nominated by emanresu A

Apple Shortcuts is a graphical utility scripting language designed to automate tasks like sending emails, setting timers or playing music. But it can be abused to do things like FizzBuzz.

This answer cleverly uses a lot of the languages' limited features, such as regex and implicit variables, to solve the problem in just 9 actions, over three times shorter than the other answer which uses 31.

Note: While a text-based format exists as a .shortcut file (see the above link), these have to be created on MacOS and downloaded, which I haven't managed to do for this answer.

Determine your language's version in Scratch (1.x, 2.0, 3.0) by qarz

nominated by UndoneStudios

This answer abuses a few technicalities of the () of () block in Scratch. In Scratch 3, the cosine of 90 is 0, but a random number in other versions. This helps separate Scratch 3 from the other versions.

This also abuses the fact that appending <not<>> to a list in Scratch 1.x will append 1, but in Scratch 2 it appends true. With a touch of golfing this returns the correct answer.

Erverse Hte Ifrst Wto Eltters fo Aech Owrd in Piet by m90

nominated by Aiden Chow

By implementing a very clever way for checking when to halt, this Piet answer comes out to be surprisingly concise, at only 25 bytes. Usually, it is quite hard to detect the end of the input in Piet without a sentinel value or some other indicator, but this Piet answer manages to check for this in a very concise way, which makes it quite impressive in my opinion. It is also accompanied by an understandable explanation as to how this Piet answer even works, and even has a great diagram to follow the pointer path as it executes the code.

\$\endgroup\$
3
2
votes
\$\begingroup\$

Rookie of the Year - Answers

Repost from 2021 and other years.

For the best answer written by a new user in 2022. This doesn't have to be a user who created their account in 2022 - rather, this is for any answer posted by a user in 2022 where that answer was that user's first answer on the site.

SEDE query (modified from the 2021 one)

Fewest (distinct) characters for Turing Completeness in Python 3 by kzh

nominated by emanresu A

For a long time, people thought that Python 3 required at least 9 distinct characters to be Turing Complete. This is the user's first and only post, and they found a way to express arbitrary Python with only eight characters. The previous record of 9 characters was posted almost six years ago.

Final tribute to John Conway: FRACTRAN self-interpreter in Fractran by benrg

nominated by emanresu A

Fractran is a Turing Tarpit in which the only operation is to attempt to multiply by a fraction, and try the next fraction if the result is not an integer. Despite this, it's Turing Complete, and it halves the pre-challenge record of 48 fractions, beating the next-best answer by 6 fractions.

Despite being so short, it offers a thorough explanation of how the program works and how it could be improved.

\$\endgroup\$
2
2
votes
\$\begingroup\$

Rookie of the Year - Challenges

Repost of 2021, 2020, 2019, 2018.

For the best challenge written by someone who has not written a challenge prior to 2022.

SEDE query thanks to mousetail

Transform characters of your choice into "Hello, world!" by Jiří

nominated by emanresu A

This is a fun challenge involving translating a list of unique characters to "Hello, world!". It's quite interesting to answer, and the answers are extremely diverse and clever. As put by xnor:

I think this is an interesting puzzle, where it might not be obvious at first to solvers that competitive answers probably shouldn't write "Hello, world!" at all in the their code.

What's the missing code by Lecdi

nominated by emanresu A

This is a really fun in which the robbers have to guess a missing substring of a piece of code. Additionally, the code with the substring removed has to be valid code, which lead to a wide variety of clever approaches, including Unicode trickery, Java method abuse and concerning substrings.

\$\endgroup\$
2
2
votes
\$\begingroup\$

Slowest Gun in the East

Repost from 2021, 2018, 2017, 2016

Too often, late answers are overlooked, and end up with fewer upvotes than answers posted immediately after the challenge is posted. This category is aimed to reward impressive answers posted a while after the challenge was originally posted and that went unappreciated, compared to the FGITW answers.

SGITE 2022 query.

Interpret brainfuck by lyxal

self-nomination

This answer is the slowest of the slowest guns posted in 2022, and is also the longest Vyxal answer I think I've ever written. At 148 bytes long, you would think that Vyxal isn't a golfing language, but the byte count comes from the fact that this brainfuck interpreter doesn't use eval/exec - it manually interprets the esolang. And it takes a very long time too, so not only is it slow in terms of posting, it's slow in terms of execution time!

Print the N-bonacci sequence by Wheat Wizard

self-nomination

This gun is indeed slow, it was posted over 3 years after xnor's Haskell answer, which it beats out by 1 byte, but it's not just a cheap trick or an oversight that it uses. The bizarre thing is that in order to solve the problem so golfily, it first solves a harder problem, or at least a more general problem, and uses that solution in two different ways to build the final answer. It's a great example of double use, that is equally capable of making me go "How did I ever even miss this?" and "How did I ever even come up with this?"

\$\endgroup\$
2
1
vote
\$\begingroup\$

Most unexpected outcome

Repost from 2021

An answer that you didn’t expect to work, or do something else, but unexpectedly did some weird behavior and made the answer valid.

This could involve some interpreter bug, or obscure feature that wasn’t documented nor known by many people.

CGAC2022 Day 8: Fen The Wicked, Part 2 by lyxal

self-nomination

At first, I had a 13 byte answer, which would make my answer the 8th shortest answer. Then, I discovered that vectorises pair-wise when given two lists, which helped me save 6 bytes. The funny part about this is that despite the fact I made the language, I completely didn't know about a feature that helped make my answer come first :p.

What's the Missing Code? (Cops) by Sisyphus and What's the Missing Code? (Robbers) by xnor

nominated by alephalpha

Since this is a challenge, I'm nominating both the cop and the robber.

I really did not expect that divmod can be written as dⅳmod in Python. Here the is U+2173 (Small Roman Numeral Four).

\$\endgroup\$
2
1
vote
\$\begingroup\$

Most involvement in an answer/answers

Repost of 2020, 2021

For an answer or multiple answers where multiple people were involved. This could be multiple people helping out a user on a single answer, or a back-and-forth between two or more answers trying to outgolf each other.

Inject arbitrary code into a compiler by DLosc and emanresu A

nominated by emanresu A (half-self-nomination)

For this challenge, people were meant to create their own languages with hidden security vulnerabilities. However, most answers were pre-existing languages, including four separate vulnerabilities in Vyxal.

DLosc was the only user to actually create a language for the challenge, creating Exceptionally, a language where turing completeness came from throwing and catching exceptions. The first version was cracked with an unintended vulnerability, so DLosc created the second version, again cracked unintentionally, and finally a third version which remained safe until the end.

This was a really fun back-and-forth and DLosc's intended solution was extremely clever and subtle.

Generate all Possibilities of Words by emanresu A, Steffan and lyxal

nominated by emanresu A (part-self-nomination)

Lyxal began with a 14 byte answer, later golfed down to 13. I (emanresu A) found a 10 byte approach, which Steffan golfed another byte off. Finally, I found a 5 byte answer.

As the comments put it:

Get outgolfed lol – emanresu A Jul 31, 2022 at 8:52

Get outgolfed lol – Steffan Jul 31, 2022 at 18:44

@Steffan no, you get outgolfed lol – emanresu A Aug 1, 2022 at 0:05

\$\endgroup\$
2
1
vote
\$\begingroup\$

Most improved answer

Repost from: 2021

This category is to reward the continued work users put into answers long after they have been posted. After the FGITW effect has dissipated there stops being so much incentive to work on an old answer, but some users put in the effort and really make it shine. The ideal answer here would be one that demonstrates a significant commitment to improvement regardless of the quality of the initial answer. This could be improving the score, or the explanation or both.

Answers in this category don't have to have been initially posted in 2022 but the improvements have to have been made over the course of the year.

Draw the Ionising Radiation Hazard Symbol in Desmos by Seggan

self-nomination

This was at first by far the longest Desmos answer to that challenge (at 178 bytes), but I decided to post it becuase I used a slightly different approach. Mine was also scalable.

I initially did some golfing of my own, getting it down to 161 bytes. Steffan then helped me with a 153 byter. I got an insight and golfed it down to 126 bytes. After talking with Aiden Chow in chat, he helped me to get it down to 119. Shortly after, we managed to replace that function with a peicewise, and combining that with a byte saved by emanresu A, we got a whole 47 byte golf. Steffan then contributed a bit more, getting the asnwer to 68 bytes. Removing the scaling feature gets me the shortest Desmos answer to that challenge: 60 bytes.

In all, the answer had been golfed 118 bytes since its posting: 12 by Steffan, 35 by me, 54 by Aiden Chow, and 1 by emanresu A.

Note: there was a 1 byte golf by Aiden Chow to the scalable version, but I have chosen to not list it here because it was made in 2023

Fibonacci word fractal by lyxal

self-nomination

Ever wondered what a chain of self-golfs while eating soup and participating in an SQL uni workshop looks like?

I started with a FGITW at 42 bytes (not included in the answer header, but in the revision history). After an hour and 17 minutes, I found there was a -1 byte shave, which got the ball rolling. At this time, I was not eating soup, nor was I in a uni workshop.

Then, another hour later, the soup started, the workshop was going well, and I found a -2 byte shave. At the time, my answer was first place, because people were still answering it. But then Kevin came in with 05AB1E and outgolfed me by about 7 or so bytes. This was obviously unacceptable, so I managed to find a -6 while eating soup, bringing the gap down to roughly 1 byte. After that, I got that gap down to 0 just 5 minutes later.

But I wasn't done. The power of WHERE clauses and database JOIN ONs was strong enough for me to find another -1. Now that doesn't seem like much, but in a golfing language where you already have something you consider short, that's a major thing. After that, I took 12 minutes to find another -1 (due to reading the challenge specs properly) and left my answer at 30 bytes. I also left the workshop 30 minutes later and placed the empty soup plate away (after cleaning it, duh.)

Then, during my nightly code golfing session (yes, I spend most nights code golfing until 12:30am - don't question my lifestyle (it's 12:09am as I write this nomination)), I managed to find another -2 bytes at 11:48pm, which brought my answer down to 28 bytes. After adding an explanation 20 minutes later, and probably wrapping a few other things up, I left the answer alone for the rest of the night (and slept.)

The next day

I woke up and saw that my 28 byter was no longer the shortest (stares at MATL and Charcoal coming in at 26 bytes). I said to myself "this is no good. I must reclaim my W". So I managed to find a way to get -3 bytes (as a -2 and then a -1 in quick succession - the revision history doesn't show the 26 byter, probably due to grace period edits or something). My answer was now 25 bytes long, which was enough to reclaim first place. But that still wasn't enough for me. 4 hours later (not all spent golfing this answer, probably only 10 minutes golfing this one answer, 3 hours and 50 minutes doing other things), I felt the need to keep experimenting with ways to shave even more bytes off - which was hard at this stage given that I was already beating the dedicated ascii-art language + the language where graphical output is a thing. There wasn't much room left for golfing.

Yet 25 bytes became 24 bytes at 9:31pm. And another hour later, 24 bytes became 23 bytes at 10:25pm. That's not to say I spent the entire hour golfing, but I probably spent a good portion of that time trying to re-arrange things. And so that's where the story ends - 18 total bytes saved. That doesn't sound like much, but in SBCS languages, a byte save of 18 bytes is probably the same as a byte shave of 100 bytes or so.

1 bowl of soup, a university workshop and 2 night golfing sessions. Who knew that's what you need to go crazy on byte shaves?

Scribble Pad for Nerds in BQN by DLosc

self-nomination

A complicated challenge for BQN resulted in a complicated answer. Over the course of a couple days, and with some help from att in the comments, I golfed my answer from 79 bytes down to 51. A little friendly rivalry with Dom Hastings' Perl answer provided extra motivation. At one point, I changed a significant chunk of my algorithm. And after every change, I made sure the explanation section was up to date.

Quicksand (piles) by Polichinelle

nominated by alephalpha

This is a challenge. The original solution was already pretty fast. After several rounds of improvements in ten days, the score improved from 2500000 to an amazing 14000000. It is the only solution that beats the hard-coded solution.

\$\endgroup\$
4
0
votes
\$\begingroup\$

Best Explanation

Repost from 2021, 2020, 2019, 2018, 2017, 2016

This category is for the answer with the best explanation accompanying it. Ideally, the winner will be an answer with a very detailed explanation that is accessible to anyone, regardless of the amount of relevant knowledge already possessed.

Interpret brainfuck by lyxal

self-nomination

Usually, golfing language answers are written in the traditional "token-by-token" explanation format:

program
pr       # comment
  ogr    # comment
     am  # comment     

This is good for when a program is just "apply this function, then that function, then another", but not when it's as complex as a non-eval brainfuck interpreter.

That's why there's a 34 paragraph (paragraph here being defined as english description + code snippet) explanation of how commands are handled, and the tricks used to shave bytes off the answer. For example:

If the command is one of + or -, then the command is duplicated yet again, and its index in the string " +" is returned. This returns 1 for + and -1 for -, as -1 is returned for characters not in the string. The 1 or -1 acts as an offset for the current cell, and saves having to check for + and - individually. It also means + can be used for both commands instead of for addition and for subtraction.

This gives an insight into the fact that instead of doing something like:

if command = "+": current_cell++
else if command = "-": current_cell--

this can be done instead:

current_cell += {"-":-1,"+":1}[command]

Check a mushroom forest by Aiden Chow

Self-nomination

Usually my Desmos answers don't have any explanation, and to a casual viewer, it would look like my answers are just a collection of random and cryptic functions and equations that somehow results in the correct answer. But in this Desmos answer, I took the time to really explain my thought process and what each part of the code does in order to make the Desmos code understandable and accessible to everyone.

Print X without X by emanresu A

self-nomination

Yes, I'm aware that I edited in the explanation in 2023. However, I posted the original answer and wrote up the explanation in 2022, so I think this counts.

After last year's Vyxal fiasco, I decided to post one more cop, using a different version of Vyxal to all the other ones. Because of this, the solution became way more complicated, with the resulting explanation being over ten kilobytes. It explains how, starting with six builtins, you can progress all the way to executing arbitrary code, explaining every step along the way from generating basic numbers all the way to arbitrary ASCII, and finally to arbitrary Vyxal code - all using only four distinct characters!

The resulting program's size is 37 yottabytes.

\$\endgroup\$
3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .