Quote Originally Posted by Jonax View Post
Then I notice all patterns are not equal. Some are quickly solved while others are tricky and demands more steps. I would be nice with some function calculating the minimum necessary steps to solve each pattern. I'm sure that could be done with brute force somehow but I'm afraid that would be quite a challenge
Actually brute-forcing this would not be so difficult. All you do is generate a tree of possible moves/paths as you progress throughout the game and then check which tree branch used the least amount of moves. Not so hard to code but it would require quite a lot of processing.

But there is a better way. As far as I can see the best strategy in this game is to go and always clear the color that is going to expose as many blocks to be cleared in the next move as possible. And when I say expose as many blocks I don't mean only the blocks that border the future grayed-out area but also their respective neighbors that are of the same color.
So you would just have to implement an algorithm that would be able to predict of how many squares of each color will you be able to clear after making certain step and then proceed making steps with best gains.
In order words you would make an AI (Arithmetic Inteligence)

Quote Originally Posted by Jonax View Post
Thanks for the instructive explanations. Now when you mention Inno Setup I once used to use it. A long time ago when there was less installaton hesitancy and I was still on Delphi 3. Inno setup was excellent, as I remember. It's still around? I should have a look at it. Anything to help mitigate the installation worries is welcome. But it's still only for Windows? No Linux version?
Yes at the moment Inno Setup is not available for Linux. I'm guessing the main reason for that is the fact that Inno setup is built using Delphi which got capability of making Linux based applications with version 10.2 and you still need to use Third Party FMX for Linux framework if you want to make applications with UI.
Any way since you are using FPC/Lazarus it might not be bad to ask around FPC/Lazarus community of what installers FPC/Lazarus people commonly use on Linux. Based on the fact that Inno Setup is also open source I would not be surprised if someone from FPC community make their own port of Inno Setup into FPC that also supports Linux. I'm not actively using FPC/Lazarus myself so I'm not up to date of that FPC community is working on.

But on the other hand installers are generally not so popular on Linux any way. On linux it is way more popular to use packages or traballs. You can read a bit more on this and possible installer alternatives here: https://unix.stackexchange.com/a/398342