Solution
This one is clearly most difficult than [Puzzle Trouble 1/2]https://hackropole.fr/en/challenges/misc/fcsc2024-misc-puzzle-trouble-1/ one and it takes at least 1 ore 2 hours to solve it by hand.
It is better to solve it with a tool…
For the first challenge, we have used an algorithm based on Euclidian distance but for this one, we need a more robust one. A better way but more difficult is to apply Genetic Algorithms, look for instance https://arxiv.org/pdf/1711.06767.
An implementation of this algorithm can be found here: GAPS.
Walkthrough
- Clone the tool :
git clone https://github.com/nemanja-m/gaps
- Run it :
gaps run ../puzzle-trouble-hard.jpg solution.jpg --generations=20 --population=600
You got :
It is not perfect but you can now use CTF Puzzle Solver assistant.
Run it with these args :
python3 pict_puzzle.py -f puzzle-trouble-hard.jpg -r 16 -c 16
and solve it line by line and column by column after placing top left corner.