I’ve done Everybody Codes, back in November. And I got all 60 stars, yeah me! 3 of the stars I only got recently, as among other things Advent of Code and mscroggs arrived in December. Nevertheless!

The Song of Ducks and Dragons [ 2025 ] ![]()
All my code is available
. I aim for low complexity, easily readable code. Including comments. And it’s in PHP.
Vyrdax
/ \
/ \
Elarzris Drakzyph
\ /
\ /
Fyrryn
Quest 1. Given a list of names, move left and right through the list (part 1). With wrapping (part 2). Or instead of moving around, swap names (part 3).
Create a system to keep track of positions. Use %. Use arrays.
A = [25,9]
R = [ 0,0]
Cycle I
R = R * R = [0,0]
R = R / [10,10] = [0,0]
R = R + A = [25,9]
Quest 2. Given a number, perform a well defined set of math instructions on that number (part 1). Given a map of points, all with coordinates, perform those math instructions of each point (part 2). (Makes a nice picture.) Increase size of map (part 3).
A lot of math. A 2d array.
10,5,1,10,3,8,5,2,2
10 > 8 > 5 > 3 > 2 > 1 the sum of the sizes: 10 + 8 + 5 + 3 + 2 + 1 = 29
10 > 8 > 5 > 2 > 1 the sum of the sizes: 10 + 8 + 5 + 2 + 1 = 26
10 > 5 > 3 > 2 the sum of the sizes: 10 + 5 + 3 + 2 = 20
10 > 5 > 2 the sum of the sizes: 10 + 5 + 2 = 17
Quest 3. Given a list of numbers, create a new list of distinct numbers with the highest sum possible (part 1). Or a list with 20 distinct numbers and the smallest sum possible (part 2). Or the lowest number of lists, covering everything from the original list.
In part 1, simply throw away the duplicates. array_unique(). In part 2, sort the unique numbers and keep the 20 smallest. In part 3, count occurrences of each number and register the largest. array_count_values(). max().
128
64
32
16
8
Quest 4. Interpret a list of numbers as teeth on neighboring gears. If the 1st gear turns 2025 times, how many times does the last gear turn (part 1)? If the last gear turns 10000000000000 times, how many times does the 1st gear turn, rounded up (part 2)? Or do the part 1 calculation again, but with more complicated gears with 2 sets of teeth (part 3).
In part 1 I calculate how many teeth were involved for the 1st gear, and then calculate how many turns that is for the last gear. Part 2 is the same in reverse. In part 3 I did the full calculation, involving all the gears.
3-5-7
|
1-8-10
|
5-9
|
7-8
Quest 5. The fishbone! Given a list of numbers, construct the valid fishbone. Then make other choices based on the result.
As I was basically doing the same thing a lot, I was quick to put stuff into functions. That actually became a guiding principle. If part 2 was “do the same as part 1, but a lot of times”, create a function. A fun function to use was usort(), a custom sorting function. Not very complicated code, just fiddly.
I am also finding a rhythm. I usually build 1 large program, because later parts don’t require a complete rewrite of earlier work. And I get used to the input for the 3 parts being different.