Merge remote-tracking branch 'origin/master'
This commit is contained in:
26
farm.py
26
farm.py
@@ -370,14 +370,14 @@ class Farm:
|
||||
# third left upper
|
||||
if e + 2 <= 7 and i - 1 >= 0:
|
||||
if state[e + 2, i - 1] == color:
|
||||
print("upper left", color, e, i)
|
||||
#print("upper left", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e + 2, i - 1])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e + 2, i])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
return True
|
||||
if e + 2 <= 7 and i + 1 <= 13:
|
||||
if state[e + 2, i + 1] == color:
|
||||
print("upper left", color, e, i)
|
||||
#print("upper left", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e + 2, i + 1])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e + 2, i])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -433,7 +433,7 @@ class Farm:
|
||||
# third left upper
|
||||
if e - 1 >= 0 and i - 1 >= 0:
|
||||
if state[e - 1, i - 1] == color and (state[e, i - 1] in self.colors):
|
||||
print("upper left", color, e, i)
|
||||
#print("upper left", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e - 1, i - 1])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e, i - 1])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -441,7 +441,7 @@ class Farm:
|
||||
# third left lower
|
||||
if e + 1 <= 7 and i - 1 >= 0:
|
||||
if state[e + 1, i - 1] == color and (state[e, i - 1] in self.colors):
|
||||
print("lower left", color, e, i)
|
||||
#print("lower left", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e + 1, i - 1])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e, i - 1])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -449,7 +449,7 @@ class Farm:
|
||||
# third left with gap
|
||||
if i - 2 >= 0:
|
||||
if state[e, i - 2] == color and (state[e, i - 1] in self.colors):
|
||||
print("left gap ", color, e, i)
|
||||
#print("left gap ", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e, i - 2])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e, i - 1])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -457,7 +457,7 @@ class Farm:
|
||||
# third right upper
|
||||
if e - 1 >= 0 and i + 2 <= 13:
|
||||
if state[e - 1, i + 2] == color and (state[e, i + 2] in self.colors):
|
||||
print("upper right", color, e, i)
|
||||
#print("upper right", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e - 1, i + 2])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e, i + 2])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -465,7 +465,7 @@ class Farm:
|
||||
# third right lower
|
||||
if e + 1 <= 7 and i + 2 <= 13:
|
||||
if state[e + 1, i + 2] == color and (state[e, i + 2] in self.colors):
|
||||
print("upper lower", color, e, i)
|
||||
#print("upper lower", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e + 1, i + 2])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e, i + 2])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -474,7 +474,7 @@ class Farm:
|
||||
# third right with gap
|
||||
if i + 3 <= 13:
|
||||
if state[e, i + 3] == color and (state[e, i + 2] in self.colors):
|
||||
print("right gap ", color, e, i)
|
||||
#print("right gap ", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e, i + 3])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e, i + 2])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -489,7 +489,7 @@ class Farm:
|
||||
# third left upper
|
||||
if e - 1 >= 0 and i - 1 >= 0:
|
||||
if state[e - 1, i - 1] == color and (state[e - 1, i] in self.colors):
|
||||
print("upper left", color, e, i)
|
||||
#print("upper left", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e - 1, i - 1])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e - 1, i])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -505,7 +505,7 @@ class Farm:
|
||||
# third right upper
|
||||
if e - 1 >= 0 and i + 1 <= 13:
|
||||
if state[e - 1, i + 1] == color and (state[e - 1, i] in self.colors):
|
||||
print("upper right", color, e, i)
|
||||
#print("upper right", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e - 1, i + 1])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e - 1, i])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -513,7 +513,7 @@ class Farm:
|
||||
# third right lower
|
||||
if e + 2 <= 7 and i + 1 <= 13:
|
||||
if state[e + 2, i + 1] == color and (state[e + 2, i] in self.colors):
|
||||
print("upper lower", color, e, i)
|
||||
#print("upper lower", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e + 2, i + 1])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e + 2, i])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -521,7 +521,7 @@ class Farm:
|
||||
# third upper with gap
|
||||
if e - 2 >= 0:
|
||||
if state[e - 2, i] == color and (state[e - 1, i] in self.colors):
|
||||
print("upper gap ", color, e, i)
|
||||
#print("upper gap ", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e - 2, i])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e - 1, i])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
@@ -529,7 +529,7 @@ class Farm:
|
||||
# third lower with gap
|
||||
if e + 3 <= 7:
|
||||
if state[e + 3, i] == color and (state[e + 2, i] in self.colors):
|
||||
print("lower gap ", color, e, i)
|
||||
#print("lower gap ", color, e, i)
|
||||
src_pt = self.get_click_point(self.data_coordinates[e + 3, i])
|
||||
dest_pt = self.get_click_point(self.data_coordinates[e + 2, i])
|
||||
self.move_tile(src_pt, dest_pt)
|
||||
|
||||
Reference in New Issue
Block a user