Code:
from PIL import ImageGrab
from PIL import Image
import colorsys
import ctypes
import time
import os
box = 203, 276, 534, 609 ## replace this with YOUR coordinates
size = 0,0,int(box[2]-box[0]),int(box[3]-box[1])
x_pad = box[0]-1
y_pad = box[1]-1
cart = [[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[1,0],[1,1],
[1,2],[1,3],[1,4],[1,5],[2,0],[2,1],[2,2],[2,3],[2,4],
[2,5],[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[4,0],[4,1],
[4,2],[4,3],[4,4],[4,5],[5,0],[5,1],[5,2],[5,3],[5,4],
[5,5]]
cc = cart[:]
replaybutton = int((size[2])*.51+x_pad), int((size[3])*.82+y_pad)
for i in range(36):
cc[i] = int((cart[i][0]+.5)*(size[2]/6)+x_pad),\
int((cart[i][1]+.5)*(size[3]/6)+y_pad)
gamecount=0
def go():
global gamecount
click(cc[18])
time.sleep(.01)
click(cc[18])
while gamecount < 50:
demo()
move()
print('Finished game ' + str(i+1))
time.sleep(2)
def swap(c, d):
ctypes.windll.user32.SetCursorPos(cc[c][0],cc[c][1])
time.sleep(.2)
ctypes.windll.user32.mouse_event(2,0,0,0,0)#leftdown
time.sleep(.2)
ctypes.windll.user32.SetCursorPos(cc[d][0],cc[d][1])
time.sleep(.2)
ctypes.windll.user32.mouse_event(4,0,0,0,0)#leftup
time.sleep(.2)
did_move_count(c)
def click((x, y)):
ctypes.windll.user32.SetCursorPos(x, y)
ctypes.windll.user32.mouse_event(2, 0, 0, 0,0) #left down
time.sleep(.3)
ctypes.windll.user32.mouse_event(4, 0, 0, 0,0) #left up
time.sleep(.4)
def demo():
swap(18,19)
time.sleep(3)
def is_board_moving():
img=ImageGrab.grab(box)
pix=img.resize((1,1),Image.ANTIALIAS).getpixel((0,0))
before=pix
time.sleep(.5)
img=ImageGrab.grab(box)
pix=img.resize((1,1),Image.ANTIALIAS).getpixel((0,0))
after=pix
if before==after:
pass
elif before!=after:
time.sleep(.5)
is_board_moving()
counter=0
def did_move_count(c):
global counter
is_board_moving()
replay()
gb=color()
before=gb[c]
time.sleep(.5)
gb=color()
after=gb[c]
if before==after:
move()
elif before!=after:
counter+=1
replay()
def replay():
global gamecount
gb=color()
if gb[35]==['over']:
click(replaybutton)
gamecount+=1
elif gb[35]!='over':
move()
def color():
gb=[]
img=ImageGrab.grab(box)
for i in range(36):
w,h=img.size
im=img.crop((int((size[2]/6)*(cart[i][0]+.15)),\
int((size[3]/6)*(cart[i][1]+.15)),\
w-int((size[2]/6)*(5-cart[i][0]+.15)),\
h-int((size[3]/6)*(5-cart[i][1]+.15))))
pix=im.resize((1,1),Image.ANTIALIAS).getpixel((0,0))
yiq=colorsys.rgb_to_yiq(pix[0],pix[1],pix[2])
ide=yiq[1]
if 60<ide<80:
gb.append(['o'])
elif 40<ide<60:
gb.append(['m'])
elif -30<ide<-10:
gb.append(['g'])
elif -60<ide<-40:
gb.append(['c'])
elif 20<ide<40:
gb.append(['y'])
elif -5<ide<10:
gb.append(['p'])
elif -10<ide<-5:
gb.append(['over'])
else:
gb.append(['?'])
return gb
def move():
global counter
while counter<5:
gb=color()
for i in range(len(p)):
c = int(p[i][0])
a = int(p[i][1])
b = int(p[i][2])
d = int(p[i][3])
if gb[a] == gb[b] == gb[c]:
swap(c, d)
return
p = [(0,2,3,1),(0,7,8,6),(0,7,13,1),(0,12,18,6),(6,1,2,0),(6,1,13,7),\
(6,8,9,7),(6,13,14,12),(6,13,19,7),(6,18,24,12),(12,1,7,13),(12,7,8,6),\
(12,7,19,13),(12,14,15,13),(12,19,20,18),(12,19,25,13),(12,24,30,18),\
(18,6,0,12),(18,7,13,19),(18,13,14,12),(18,13,25,19),(18,20,21,19),\
(18,25,26,24),(18,25,31,19),(24,12,6,18),(24,13,19,25),(24,19,20,18),\
(24,19,31,25),(24,26,27,25),(24,31,32,30),(30,18,12,24),(30,19,25,31),\
(30,25,26,24),(30,32,33,31),(1,3,4,2),(1,6,8,7),(1,6,12,0),(1,8,9,7),\
(1,8,14,2),(1,13,19,7),(7,0,2,1),(7,0,12,6),(7,2,3,1),(7,2,14,8),(7,9,10,8),\
(7,12,14,13),(7,12,18,6),(7,14,15,13),(7,14,20,8),(7,19,25,13),(13,0,6,12),\
(13,2,8,14),(13,6,8,7),(13,6,18,12),(13,8,9,7),(13,8,20,14),(13,15,16,14),\
(13,18,20,19),(13,18,24,12),(13,20,21,19),(13,20,26,14),(13,25,31,19),\
(19,6,12,18),(19,7,1,13),(19,8,14,20),(19,12,14,13),(19,12,24,18),(19,14,15,13),\
(19,14,26,20),(19,21,22,20),(19,24,26,25),(19,24,30,18),(19,26,27,25),(19,26,32,20),\
(25,12,18,24),(25,13,7,19),(25,14,20,26),(25,18,20,19),(25,18,30,24),(25,20,21,19),\
(25,20,32,26),(25,27,28,26),(25,30,32,31),(25,32,33,31),(31,18,24,30),(31,19,13,25),\
(31,20,26,32),(31,24,26,25),(31,26,27,25),(31,33,34,32),(2,4,5,3),(2,6,7,8),(2,7,9,8),\
(2,7,13,1),(2,9,10,8),(2,9,15,3),(2,14,20,8),(8,0,1,2),(8,1,3,2),(8,1,13,7),(8,3,4,2),\
(8,3,15,9),(8,10,11,9),(8,12,13,14),(8,13,15,14),(8,13,19,7),(8,15,16,14),(8,15,21,9),\
(8,20,26,14),(14,1,7,13),(14,3,9,15),(14,6,7,8),(14,7,9,8),(14,7,19,13),(14,9,10,8),\
(14,9,21,15),(14,16,17,15),(14,18,19,20),(14,19,21,20),(14,19,25,13),(14,21,22,20),\
(14,21,27,15),(14,26,32,20),(20,7,13,19),(20,8,2,14),(20,9,15,21),(20,12,13,14),\
(20,13,15,14),(20,13,25,19),(20,15,16,14),(20,15,27,21),(20,22,23,21),(20,24,25,26),\
(20,25,27,26),(20,25,31,19),(20,27,28,26),(20,27,33,21),(26,13,19,25),(26,14,8,20),\
(26,15,21,27),(26,18,19,20),(26,19,21,20),(26,19,31,25),(26,21,22,20),(26,21,33,27),\
(26,28,29,27),(26,30,31,32),(26,31,33,32),(26,33,34,32),(32,19,25,31),(32,20,14,26),\
(32,21,27,33),(32,24,25,26),(32,25,27,26),(32,27,28,26),(32,34,35,33),(3,0,1,2),\
(3,7,8,9),(3,8,10,9),(3,8,14,2),(3,10,11,9),(3,10,16,4),(3,15,21,9),(9,1,2,3),\
(9,2,4,3),(9,2,14,8),(9,4,5,3),(9,4,16,10),(9,6,7,8),(9,13,14,15),(9,14,16,15),\
(9,14,20,8),(9,16,17,15),(9,16,22,10),(9,21,27,15),(15,2,8,14),(15,4,10,16),\
(15,7,8,9),(15,8,10,9),(15,8,20,14),(15,10,11,9),(15,10,22,16),(15,12,13,14),\
(15,19,20,21),(15,20,22,21),(15,20,26,14),(15,22,23,21),(15,22,28,16),(15,27,33,21),\
(21,8,14,20),(21,9,3,15),(21,10,16,22),(21,13,14,15),(21,14,16,15),(21,14,26,20),\
(21,16,17,15),(21,16,28,22),(21,18,19,20),(21,25,26,27),(21,26,28,27),(21,26,32,20),\
(21,28,29,27),(21,28,34,22),(27,14,20,26),(27,15,9,21),(27,16,22,28),(27,19,20,21),\
(27,20,22,21),(27,20,32,26),(27,22,23,21),(27,22,34,28),(27,24,25,26),(27,31,32,33),\
(27,32,34,33),(27,34,35,33),(28,15,21,27),(33,20,26,32),(33,21,15,27),(33,22,28,34),\
(33,25,26,27),(33,26,28,27),(33,28,29,27),(33,30,31,32),(4,1,2,3),(4,8,9,10),(4,9,11,10),\
(4,9,15,3),(4,11,17,5),(4,16,22,10),(10,2,3,4),(10,3,5,4),(10,3,15,9),(10,5,17,11),(10,7,8,9),\
(10,14,15,16),(10,15,17,16),(10,15,21,9),(10,17,23,11),(10,22,28,16),(16,3,9,15),(16,5,11,17),\
(16,8,9,10),(16,9,11,10),(16,9,21,15),(16,11,23,17),(16,13,14,15),(16,20,21,22),(16,21,23,22),\
(16,21,27,15),(16,23,29,17),(16,28,34,22),(22,9,15,21),(22,10,4,16),(22,11,17,23),(22,14,15,16),\
(22,15,17,16),(22,15,27,21),(22,17,29,23),(22,19,20,21),(22,26,27,28),(22,27,29,28),(22,27,33,21),\
(22,29,35,23),(28,16,10,22),(28,17,23,29),(28,20,21,22),(28,21,23,22),(28,21,33,27),(28,23,35,29),\
(28,25,26,27),(28,32,33,34),(28,33,35,34),(34,21,27,33),(34,22,16,28),(34,23,29,35),(34,26,27,28),\
(34,27,29,28),(34,31,32,33),(5,2,3,4),(5,9,10,11),(5,10,16,4),(5,17,23,11),(11,3,4,5),(11,4,16,10),\
(11,8,9,10),(11,15,16,17),(11,16,22,10),(11,23,29,17),(17,4,10,16),(17,9,10,11),(17,10,22,16),\
(17,14,15,16),(17,21,22,23),(17,22,28,16),(17,29,35,23),(23,10,16,22),(23,11,5,17),(23,15,16,17),\
(23,16,28,22),(23,20,21,22),(23,27,28,29),(23,28,34,22),(29,16,22,28),(29,17,11,23),(29,21,22,23),\
(29,22,34,28),(29,26,27,28),(29,33,34,35),(35,22,28,34),(35,23,17,29),(35,27,28,29),(35,32,33,34)]
c = p[i][0]
a = p[i][1]
b = p[i][2]
d = p[i][3]
Code:
from PIL import ImageGrab
from PIL import Image
import colorsys
import ctypes
import time
box = 203, 276, 534, 609 ## replace this with your coordinates
maxgames = 5 ## replace this with how many games you'd like to play
#maxgames = input('How many games would you like to play? ')
''' or put a hashtag in front of the first maxgames and
delete the hastag from this maxgames and when you start,
the bot, it'll ask you for how many games you'd like to play.
'''
counter=0
size = 0,0,int(box[2]-box[0]),int(box[3]-box[1])
x_pad = box[0]-1
y_pad = box[1]-1
def go():
click(cc[18])
click(cc[18])
demo()
### to run, hit F5 and type "go()" (without quotes)
''' to 'fast' run, delete the hashtag in front of the go()
at the bottom of this script. just save, exit, and then
double click on the icon.
'''
cart = [[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[1,0],[1,1],
[1,2],[1,3],[1,4],[1,5],[2,0],[2,1],[2,2],[2,3],[2,4],
[2,5],[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[4,0],[4,1],
[4,2],[4,3],[4,4],[4,5],[5,0],[5,1],[5,2],[5,3],[5,4],
[5,5]]
'''
> these are grid coordinates
> go in order from cell #0 to cell #35.
> (0,0) is top right corner, also cell #0...
(0,1) is right below it, also cell #1...
(5,5) is bottom left corner, also cell #35
> this:
(0,0) (1,0) (2,0) (3,0) (4,0) (5,0)
(0,1) (1,1) (2,1) (3,1) (4,1) (5,1)
(0,2) (1,2) (2,2) (3,2) (4,2) (5,2)
(0,3) (1,3) (2,3) (3,3) (4,3) (5,3)
(0,4) (1,4) (2,4) (3,4) (4,4) (5,4)
(0,5) (1,5) (2,5) (3,5) (4,5) (5,5)
> and this:
0, 6, 12, 18, 24, 30
1, 7, 13, 19, 25, 31
2, 8, 14, 20, 26, 32
3, 9, 15, 21, 27, 33
4, 10, 16, 22, 28, 34
5, 11, 17, 23, 29, 35
'''
cc = cart[:]
replaybutton = int((size[2])*.51+x_pad), int((size[3])*.82+y_pad)
for i in range(36):
cc[i] = int((cart[i][0]+.5)*(size[2]/6)+x_pad),\
int((cart[i][1]+.5)*(size[3]/6)+y_pad)
'''
> replay button is where the replay button is located:
about halfway horizontally and a bit more than halfway vertically
> cc[i] is the (x,y) pixel coordinate of the cell (where to click),
> i correlates to cell #, so cc[0] is for cell #0.
'''
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
def click((x, y)):
ctypes.windll.user32.SetCursorPos(x, y)
time.sleep(.01)
ctypes.windll.user32.mouse_event(2, 0, 0, 0,0) #left down
time.sleep(.01)
ctypes.windll.user32.mouse_event(4, 0, 0, 0,0) #left up
time.sleep(.01)
'''
> simple function.
> only really used for go() to activate game window
and to click the replay button
'''
def swap(c, d):
ctypes.windll.user32.SetCursorPos(cc[c][0],cc[c][1])
time.sleep(.1)
ctypes.windll.user32.mouse_event(2,0,0,0,0)#leftdown
time.sleep(.1)
ctypes.windll.user32.SetCursorPos(cc[d][0],cc[d][1])
time.sleep(.1)
ctypes.windll.user32.mouse_event(4,0,0,0,0)#leftup
time.sleep(1)
replay()
'''
> simple function.
> moves cursor over current cell.
> holds left click down on mouse and drags over to swapping cell.
> releases left click up on mouse, waits, and then sends to replay to see if done.
'''
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
def demo():
global counter
print('Playing game ' + str(counter) + ' of ' + str(maxgames))
swap(18,19)
'''
> prints what game youre on and how close you are to being
done with your max games.
> first move of level one is always combination.
'''
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
def replay():
global counter
gb=color()
if gb[35]==['over']:
if counter<maxgames:
time.sleep(3)
click(replaybutton)
counter+=1
time.sleep(3)
demo()
else:
print('Finished')
done()
elif gb[35]!='over':
move()
'''
> after every swap, it checks to see if game is done.
> finds color value of cell #35.
> if color value returns 'over',
clicks replaybutton and starts from demo.
- adds game to counter
> if color value does not return 'over',
continues making moves.
'''
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
def move():
gb=color()
for i in range(len(p)):
c = int(p[i][0]) #current cell
a = int(p[i][1]) #condition cell 1
b = int(p[i][2]) #condition cell 2
d = int(p[i][3]) #swapping cell
if gb[a] == gb[b] == gb[c]:
swap(c, d)
return
'''
> takes list gb from color fcn (see further below)
> uses sets from list p (see further below)
as indices to search thru list gb.
> once it finds a match, it makes a move.
'''
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
def done():
while True:
time.sleep(100)
'''
> The game is done with its max games
and it's waiting for you to close. :)
'''
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
def color():
gb=[]
img=ImageGrab.grab(box)
for i in range(36):
w,h=img.size
im=img.crop((int((size[2]/6)*(cart[i][0]+.15)),\
int((size[3]/6)*(cart[i][1]+.15)),\
w-int((size[2]/6)*(5-cart[i][0]+.15)),\
h-int((size[3]/6)*(5-cart[i][1]+.15))))
pix=im.resize((1,1),Image.ANTIALIAS).getpixel((0,0))
yiq=colorsys.rgb_to_yiq(pix[0],pix[1],pix[2])
ide=yiq[1]
if 60<ide<80:
gb.append(['o'])
elif 40<ide<60:
gb.append(['m'])
elif -30<ide<-10:
gb.append(['g'])
elif -60<ide<-40:
gb.append(['c'])
elif 20<ide<40:
gb.append(['y'])
elif -5<ide<10:
gb.append(['p'])
elif -10<ide<-5:
gb.append(['over'])
else:
gb.append(['?'])
return gb
'''
> takes screenshot of board.
> crops the screenshot 36 times.
> reduces each cropped image to a 1x1 pixel image.
> finds RGB value and translates it to YIQ.
> uses I value range to label cell by color.
> inputs color into list gb.
> think of gb as gameboard.
'''
#### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### ####
p = [(18,13,25,19),(0,2,3,1),(0,7,8,6),(0,7,13,1),(0,12,18,6),(6,1,2,0),(6,1,13,7),\
(6,8,9,7),(6,13,14,12),(6,13,19,7),(6,18,24,12),(12,1,7,13),(12,7,8,6),\
(12,7,19,13),(12,14,15,13),(12,19,20,18),(12,19,25,13),(12,24,30,18),\
(18,6,0,12),(18,7,13,19),(18,13,14,12),(18,13,25,19),(18,20,21,19),\
(18,25,26,24),(18,25,31,19),(24,12,6,18),(24,13,19,25),(24,19,20,18),\
(24,19,31,25),(24,26,27,25),(24,31,32,30),(30,18,12,24),(30,19,25,31),\
(30,25,26,24),(30,32,33,31),(1,3,4,2),(1,6,8,7),(1,6,12,0),(1,8,9,7),\
(1,8,14,2),(1,13,19,7),(7,0,2,1),(7,0,12,6),(7,2,3,1),(7,2,14,8),(7,9,10,8),\
(7,12,14,13),(7,12,18,6),(7,14,15,13),(7,14,20,8),(7,19,25,13),(13,0,6,12),\
(13,2,8,14),(13,6,8,7),(13,6,18,12),(13,8,9,7),(13,8,20,14),(13,15,16,14),\
(13,18,20,19),(13,18,24,12),(13,20,21,19),(13,20,26,14),(13,25,31,19),\
(19,6,12,18),(19,7,1,13),(19,8,14,20),(19,12,14,13),(19,12,24,18),(19,14,15,13),\
(19,14,26,20),(19,21,22,20),(19,24,26,25),(19,24,30,18),(19,26,27,25),(19,26,32,20),\
(25,12,18,24),(25,13,7,19),(25,14,20,26),(25,18,20,19),(25,18,30,24),(25,20,21,19),\
(25,20,32,26),(25,27,28,26),(25,30,32,31),(25,32,33,31),(31,18,24,30),(31,19,13,25),\
(31,20,26,32),(31,24,26,25),(31,26,27,25),(31,33,34,32),(2,4,5,3),(2,6,7,8),(2,7,9,8),\
(2,7,13,1),(2,9,10,8),(2,9,15,3),(2,14,20,8),(8,0,1,2),(8,1,3,2),(8,1,13,7),(8,3,4,2),\
(8,3,15,9),(8,10,11,9),(8,12,13,14),(8,13,15,14),(8,13,19,7),(8,15,16,14),(8,15,21,9),\
(8,20,26,14),(14,1,7,13),(14,3,9,15),(14,6,7,8),(14,7,9,8),(14,7,19,13),(14,9,10,8),\
(14,9,21,15),(14,16,17,15),(14,18,19,20),(14,19,21,20),(14,19,25,13),(14,21,22,20),\
(14,21,27,15),(14,26,32,20),(20,7,13,19),(20,8,2,14),(20,9,15,21),(20,12,13,14),\
(20,13,15,14),(20,13,25,19),(20,15,16,14),(20,15,27,21),(20,22,23,21),(20,24,25,26),\
(20,25,27,26),(20,25,31,19),(20,27,28,26),(20,27,33,21),(26,13,19,25),(26,14,8,20),\
(26,15,21,27),(26,18,19,20),(26,19,21,20),(26,19,31,25),(26,21,22,20),(26,21,33,27),\
(26,28,29,27),(26,30,31,32),(26,31,33,32),(26,33,34,32),(32,19,25,31),(32,20,14,26),\
(32,21,27,33),(32,24,25,26),(32,25,27,26),(32,27,28,26),(32,34,35,33),(3,0,1,2),\
(3,7,8,9),(3,8,10,9),(3,8,14,2),(3,10,11,9),(3,10,16,4),(3,15,21,9),(9,1,2,3),\
(9,2,4,3),(9,2,14,8),(9,4,5,3),(9,4,16,10),(9,6,7,8),(9,13,14,15),(9,14,16,15),\
(9,14,20,8),(9,16,17,15),(9,16,22,10),(9,21,27,15),(15,2,8,14),(15,4,10,16),\
(15,7,8,9),(15,8,10,9),(15,8,20,14),(15,10,11,9),(15,10,22,16),(15,12,13,14),\
(15,19,20,21),(15,20,22,21),(15,20,26,14),(15,22,23,21),(15,22,28,16),(15,27,33,21),\
(21,8,14,20),(21,9,3,15),(21,10,16,22),(21,13,14,15),(21,14,16,15),(21,14,26,20),\
(21,16,17,15),(21,16,28,22),(21,18,19,20),(21,25,26,27),(21,26,28,27),(21,26,32,20),\
(21,28,29,27),(21,28,34,22),(27,14,20,26),(27,15,9,21),(27,16,22,28),(27,19,20,21),\
(27,20,22,21),(27,20,32,26),(27,22,23,21),(27,22,34,28),(27,24,25,26),(27,31,32,33),\
(27,32,34,33),(27,34,35,33),(28,15,21,27),(33,20,26,32),(33,21,15,27),(33,22,28,34),\
(33,25,26,27),(33,26,28,27),(33,28,29,27),(33,30,31,32),(4,1,2,3),(4,8,9,10),(4,9,11,10),\
(4,9,15,3),(4,11,17,5),(4,16,22,10),(10,2,3,4),(10,3,5,4),(10,3,15,9),(10,5,17,11),(10,7,8,9),\
(10,14,15,16),(10,15,17,16),(10,15,21,9),(10,17,23,11),(10,22,28,16),(16,3,9,15),(16,5,11,17),\
(16,8,9,10),(16,9,11,10),(16,9,21,15),(16,11,23,17),(16,13,14,15),(16,20,21,22),(16,21,23,22),\
(16,21,27,15),(16,23,29,17),(16,28,34,22),(22,9,15,21),(22,10,4,16),(22,11,17,23),(22,14,15,16),\
(22,15,17,16),(22,15,27,21),(22,17,29,23),(22,19,20,21),(22,26,27,28),(22,27,29,28),(22,27,33,21),\
(22,29,35,23),(28,16,10,22),(28,17,23,29),(28,20,21,22),(28,21,23,22),(28,21,33,27),(28,23,35,29),\
(28,25,26,27),(28,32,33,34),(28,33,35,34),(34,21,27,33),(34,22,16,28),(34,23,29,35),(34,26,27,28),\
(34,27,29,28),(34,31,32,33),(5,2,3,4),(5,9,10,11),(5,10,16,4),(5,17,23,11),(11,3,4,5),(11,4,16,10),\
(11,8,9,10),(11,15,16,17),(11,16,22,10),(11,23,29,17),(17,4,10,16),(17,9,10,11),(17,10,22,16),\
(17,14,15,16),(17,21,22,23),(17,22,28,16),(17,29,35,23),(23,10,16,22),(23,11,5,17),(23,15,16,17),\
(23,16,28,22),(23,20,21,22),(23,27,28,29),(23,28,34,22),(29,16,22,28),(29,17,11,23),(29,21,22,23),\
(29,22,34,28),(29,26,27,28),(29,33,34,35),(35,22,28,34),(35,23,17,29),(35,27,28,29),(35,32,33,34)]
'''
> think of as possible swap combination directory.
> top swaps have priority.
> reads as (current, condition 1, condition 2, swapping)
> for example, (0,2,3,1) reads like this:
- ask, can I move cell #0?
- look, does cell #2 and cell #3 match cell #0?
- swap, if yes, swap cell #0 for cell #1.
'''
#go()
^