Changes

Jump to navigation Jump to search
Line 43: Line 43:  
<pre>
 
<pre>
 
def _turtle_strategy(self, turtle):
 
def _turtle_strategy(self, turtle):
     c = turtle[1] % 2
+
     evenodd = turtle[1] % 2
 
     for i in range(6):
 
     for i in range(6):
         column = turtle[0] + CIRCLE[c][i][0]
+
         column = turtle[0] + CIRCLE[evenodd][i][0]
         row = turtle[1] + CIRCLE[c][i][1]
+
         row = turtle[1] + CIRCLE[evenodd][i][1]
 
         if not self._dots[self._grid_to_dot((column, row))].type:
 
         if not self._dots[self._grid_to_dot((column, row))].type:
 
             return [column, row]
 
             return [column, row]
Line 56: Line 56:  
<pre>
 
<pre>
 
def _turtle_strategy(self, turtle):
 
def _turtle_strategy(self, turtle):
     c = turtle[1] % 2
+
     evenodd = turtle[1] % 2
 
     for i in range(6):
 
     for i in range(6):
         column = turtle[0] + CIRCLE[c][i][0]
+
         column = turtle[0] + CIRCLE[evenodd][i][0]
         row = turtle[1] + CIRCLE[c][i][1]
+
         row = turtle[1] + CIRCLE[evenodd][i][1]
 
         if not self._dots[self._grid_to_dot((column, row))].type:
 
         if not self._dots[self._grid_to_dot((column, row))].type:
 
             self._orientation = i
 
             self._orientation = i
Line 70: Line 70:  
<pre>
 
<pre>
 
def _turtle_strategy(self, turtle):
 
def _turtle_strategy(self, turtle):
     c = turtle[1] % 2
+
     evenodd = turtle[1] % 2
 
     n = int(uniform(0, 6))
 
     n = int(uniform(0, 6))
 
     for i in range(6):
 
     for i in range(6):
         column = turtle[0] + CIRCLE[c][(i + n) % 6][0]
+
         column = turtle[0] + CIRCLE[evenodd][(i + n) % 6][0]
         row = turtle[1] + CIRCLE[c][(i + n) % 6][1]
+
         row = turtle[1] + CIRCLE[evenodd][(i + n) % 6][1]
 
         if not self._dots[self._grid_to_dot((column, row))].type:
 
         if not self._dots[self._grid_to_dot((column, row))].type:
 
             self._orientation = (i + n) % 6
 
             self._orientation = (i + n) % 6
Line 85: Line 85:  
<pre>
 
<pre>
 
def _turtle_strategy(self, turtle):
 
def _turtle_strategy(self, turtle):
     c = turtle[1] % 2
+
     evenodd = turtle[1] % 2
 
     for i in range(6):
 
     for i in range(6):
         column = turtle[0] + CIRCLE[c][i][0]
+
         column = turtle[0] + CIRCLE[evenodd][i][0]
         row = turtle[1] + CIRCLE[c][i][1]
+
         row = turtle[1] + CIRCLE[evenodd][i][1]
 
         if self._dots[self._grid_to_dot((column, row))].type is None:
 
         if self._dots[self._grid_to_dot((column, row))].type is None:
 
             self._orientation = i
 
             self._orientation = i
Line 95: Line 95:  
     n = int(uniform(0, 6))
 
     n = int(uniform(0, 6))
 
     for i in range(6):
 
     for i in range(6):
         column = turtle[0] + CIRCLE[c][(i + n) % 6][0]
+
         column = turtle[0] + CIRCLE[evenodd][(i + n) % 6][0]
         row = turtle[1] + CIRCLE[c][(i + n) % 6][1]
+
         row = turtle[1] + CIRCLE[evenodd][(i + n) % 6][1]
 
         if not self._dots[self._grid_to_dot((column, row))].type:
 
         if not self._dots[self._grid_to_dot((column, row))].type:
 
             self._orientation = (i + n) % 6
 
             self._orientation = (i + n) % 6

Navigation menu