sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #14828
[Question #215515]: Puzzle slolver
New question #215515 on Sikuli:
https://answers.launchpad.net/sikuli/+question/215515
Hi
I need someone give me a hint or a start to begin my Puzzle solver
I want to solve a puzzle like this
row 1 (1,5,3,4,4,2)
row 2 (5,4,4,2,1,1)
row 3 (1,1,2,3,3,4)
3 rows with 6 columns
the goal is to connect as much as 3 same number together as possible in 1 move
the way to reorganize the puzzle is by swiping the location
like this
for example , this example will give us 2 combos
if i want to make 4,4,4 together in row 1 i need to move the 4 from row 2 to row 1
starting point is the [3]
row 1 (1,5,[3],4,4,2) ----->(1,5,4,4,4,2)
row 2 (5,4,4,2,1,1) ----->(5,4,[3],2,1,1)
row 3 (1,1,2,3,3,4) ----->(1,1,2,3,3,4)
if i now move that 3 to the bottom row, i will have 2 combos, 444 on the row 1 and 333 on row 3
row 1 (1,5,4,4,4,2) ----->(1,5,4,4,4,2)
row 2 (5,4,[3],2,1,1) ----->(5,4,2,2,1,1)
row 3 (1,1,2,3,3,4) ----->(1,1,[3],3,3,4)
This example will give us 3 combos even i start with the same [3]
row 1 (1,5,[3],4,4,2)----->(1,5,4,[3],4,2)----->(1,5,4,4,[3],2)----->(1,5,4,4,2,[3])
row 2 (5,4,4,2,1,1) ----->(5,4,4,2,1,1) ----->(5,4,4,2,1,1) ----->(5,4,4,2,1,1)
row 3 (1,1,2,3,3,4) ----->(1,1,2,3,3,4) ----->(1,1,2,3,3,4) ----->(1,1,2,3,3,4)
then this is tricky bit
row 1 (1,5,4,4,2,[3]) -->(1,5,4,4,2,1) --> (1,5,4,4,2,1)-->(1,5,4,4,[3],1)-->(1,5,4,[3],4,1)-->(1,5,[3],4,4,1)
row 2 (5,4,4,2,1,1) --> (5,4,4,2,1,[3])-->(5,4,4,2,[3],1)-->(5,4,4,2,2,1)-->(5,4,4,2,2,1)--> (5,4,4,2,2,1)
row 3 (1,1,2,3,3,4) -->(1,1,2,3,3,4) -->(1,1,2,3,3,4) -->(1,1,2,3,3,4) -->(1,1,2,3,3,4) --> (1,1,2,3,3,4)
then this is final tricky bit
row 1 (1,5,[3],4,4,1)-->(1,5,4,4,4,1) --> (1,5,4,4,4,1)
row 2 (5,4,4,2,2,1) --> (5,4,[3],2,2,1)-->(5,4,2,2,2,1)
row 3 (1,1,2,3,3,4) --> (1,1,2,3,3,4) --> (1,1,[3],3,3,4)
now we have 3 combos, 444,222,333
Sorry i write so much to make sure you know what i like to achieve
so back to the programming part.
i know i should start with array
then possible a series of IF checking?
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.