Blog Posts

I try to post new content every week. The search bar above can help you find what you’re looking for.

You may also find the following links useful:
2025Tags

Advent of Code 2024 Ruby Solutions: Day 6
Advent of Code 2024 Ruby Solutions: Day 6

First I’d like to apologise that this is the second week in a row that I’ve covering Advent of Code. I’ve not had as much time to write this week as I’d like to. I will try to get something more substantial out in the following weeks.

Day 6 of Advent of Code 2024 turned out …

Advent of Code 2024 Ruby Solutions: Day 5
Advent of Code 2024 Ruby Solutions: Day 5

Day 5 of Advent of Code 2024 is all about enforcing page ordering rules and pulling the “middle” value out at the right time, and my Ruby solution keeps it tidy with a small helper, a simple validator, and a lightweight reordering trick for the second half. If you want to browse …

Sudoku Series: Implementing the Fish Rules
Sudoku Series: Implementing the Fish Rules

The next rules to implement for the Sudoku solver are called the fish rules. There are three versions of these rules but they all share the same principles:

  • X-Wing works with a 2x2 fish pattern.
  • Swordfish works with a 3x3 fish pattern.
  • Jellyfish works with a 4x4 fish pattern.

If you like this post …

Advent of Code 2024 Ruby Solutions: Day 4
Advent of Code 2024 Ruby Solutions: Day 4

Day 4 of Advent of Code 2024 turns a simple word search into a neat grid‑traversal exercise, and my Ruby solution keeps it readable, fast, and precise. This post explains the requirements for both parts, then walks through how the code solves them, including how diagonals and boundaries are handled. …

Sudoku Series: Implementing the Locked Candidates Rule
Sudoku Series: Implementing the Locked Candidates Rule

Up until now in the Sudoku Series we’ve implemented a number of rules for Sudoku solving. I had been trying to remember the name of an old iPhone Sudoku app I used to enjoy. The reason I wanted to find it was that it used to be good at reviewing a puzzle and telling you what the next logical …

Advent of Code 2024 Ruby Solutions: Day 3
Advent of Code 2024 Ruby Solutions: Day 3

Advent of Code is an annual event that invites programmers to solve a series of themed puzzles each December, and this post is the third in my ongoing series for 2024. Day 3, “Mull It Over”, seemed simple at first glance: find and evaluate multiplications in a corrupted memory dump. But …

Sudoku Series: Implementing Hidden Set Rules
Sudoku Series: Implementing Hidden Set Rules

In the last Sudoku Series blog post we implemented the naked pair and the naked triple rules. In this post, we will look at implementing the hidden single, hidden pair and hidden triple rules. Applying these rules is documented on many websites, but the two I’ve liked during my research are …

Advent of Code 2024 Ruby Solutions: Day 2
Advent of Code 2024 Ruby Solutions: Day 2

A couple of weeks ago, I published the first post in my Ruby solutions to Advent of Code 2024. In this second post of the series, we’ll tackle Day 2’s challenge: “Red-Nosed Reports.” Join me as we explore the problem, understand the requirements, and walk through my Ruby …

Sudoku Series: Implementing Naked Set Rules
Sudoku Series: Implementing Naked Set Rules

In the last Sudoku Series blog post we implemented the single candidate rule. In this post, we will look at implementing both the naked pair rule and the naked triple rule. These are documented alongside more advanced rules on a Mastering Sudoku website.

If you like this post and you’d like to …

Advent of Code 2024 Ruby Solutions: Day 1
Advent of Code 2024 Ruby Solutions: Day 1

Advent of Code is an annual programming event that offers daily puzzles throughout December, delighting enthusiasts with clever challenges and a festive spirit. If you’d like to know more about what Advent of Code entails, take a look at my previous blog post: Advent of Code Introduction.

I’m …

Sudoku Series: Implementing the Single Candidate Rule
Sudoku Series: Implementing the Single Candidate Rule

This week, we hit a major milestone: our solver can now complete very easy Sudoku puzzles, thanks to the simplest rule of all — the single candidate rule. By writing code that parses the grid repeatedly and looks for opportunities to apply this rule, we’re able to solve some of the simplest …

Sudoku Series: Locating Your Neighbours
Sudoku Series: Locating Your Neighbours

When solving Sudoku puzzles, a lot of the logic is about spotting patterns among groups of cells. In this context, a group of cells are those which must not contain a number among them more than once. Let’s build some logic to pick out groups of cells we might want to work with in our solving …