Since the first time I played through this Tibia quest I felt intrigued by the little pillow puzzles it had on Mission 2. I started to code a few years later and ever since I've felt the need to find a way to solve it programatically. After years of postponing it, telling myself it was too difficult, I've finally managed to do it. This is the result.
Here's a little example that uses the DreamersSolver
class to solve a DramersBoard
created from a predefined tiles
table and then prints the amount of steps taken to solve it:
function callback(step)
print(sept.dir, step.n)
end
local b = DreamersBoard:new({
{1, 2, 3, 4, 1, 2},
{3, 4, 1, 2, 3, 4},
{1, 2, 3, 4, 1, 2},
{3, 4, 1, 2, 3, 4},
{1, 2, 3, 4, 1, 2},
{3, 4, 1, 2, 3, 4}
}, callback)
local s = DreamersSolver:new(b, {
{1, 2},
{3, 4}
})
s:solveBoard()
if s:checkBoard() then
print('Board solved!')
end
If you have any code to add, please make a pull request. If you have any suggestion, please open an issue. You can take a look at the todo list below for anything that needs to be done. Any contribution is welcome.
- Add an implementation with
synchronize
for other bots. - Add algorithm details for each quarter.
- Improve algorithm.
Dreamer's Challenge Solver is open-sourced software licensed under the MIT license.