(self, x, y, grid)
| 127 | return self.vMoves |
| 128 | |
| 129 | def Bishop(self, x, y, grid): |
| 130 | for i in range(1, 8): |
| 131 | if (x + i < 8) and (y + i < 8): |
| 132 | if grid[x + i][y + i] == 0: |
| 133 | self.vMoves.append([x + i, y + i]) |
| 134 | continue |
| 135 | if not self.sameColor(x + i, y + i, grid): |
| 136 | self.vMoves.append([x + i, y + i]) |
| 137 | break |
| 138 | break |
| 139 | else: |
| 140 | break |
| 141 | for i in range(1, 8): |
| 142 | if (x - i >= 0) and (y - i >= 0): |
| 143 | if grid[x - i][y - i] == 0: |
| 144 | self.vMoves.append([x - i, y - i]) |
| 145 | continue |
| 146 | if not self.sameColor(x - i, y - i, grid): |
| 147 | self.vMoves.append([x - i, y - i]) |
| 148 | break |
| 149 | break |
| 150 | else: |
| 151 | break |
| 152 | for i in range(1, 8): |
| 153 | if (x + i < 8) and (y - i >= 0): |
| 154 | if grid[x + i][y - i] == 0: |
| 155 | self.vMoves.append([x + i, y - i]) |
| 156 | continue |
| 157 | if not self.sameColor(x + i, y - i, grid): |
| 158 | self.vMoves.append([x + i, y - i]) |
| 159 | break |
| 160 | break |
| 161 | else: |
| 162 | break |
| 163 | for i in range(1, 8): |
| 164 | if (x - i >= 0) and (y + i < 8): |
| 165 | if grid[x - i][y + i] == 0: |
| 166 | self.vMoves.append([x - i, y + i]) |
| 167 | continue |
| 168 | if not self.sameColor(x - i, y + i, grid): |
| 169 | self.vMoves.append([x - i, y + i]) |
| 170 | break |
| 171 | break |
| 172 | else: |
| 173 | break |
| 174 | |
| 175 | return self.vMoves |
| 176 | |
| 177 | def Knight(self, x, y, grid): |
| 178 | if ( |
no test coverage detected