TL;DR

Where much code is provided, with little to no explanation

After looking at how to parse the input puzzle for aquarium, and before going on in analyzing how to solve it, let’s take an initial stop to display it properly on the terminal.

The code is available in stage 2 inside the aquarium-solver repository. It leverages Term::ANSIColor as well as a train of tricks and hacks which do not exactly make me proud.

It works, see an example below:

aquarium puzzle 681,742 solved

The solution in the stage 2 code is just hard-coded and valid for the example puzzle, of course. It’s just there to let us take a glimpse of what to expect eventually…

Module Term::ANSIColor needs to be installed, which can be done thanks to the cpanfile in the aquarium-solver repository. If you need help in using it, please take a look at Installing Perl Modules. The cpanfile also contains indications to install module Try::Catch, which we will use in later stages.