(self, matrix, x, y, result, stop)
| 103 | return self.up(matrix, x, y-1, result, stop) |
| 104 | |
| 105 | def up(self, matrix, x, y, result, stop): |
| 106 | if checkStop(matrix, x, y): |
| 107 | return result |
| 108 | |
| 109 | while 1: |
| 110 | try: |
| 111 | # matrix |
| 112 | if matrix[y][x] == 'x' or y < 0: |
| 113 | raise IndexError |
| 114 | result.append(matrix[y][x]) |
| 115 | matrix[y][x] = 'x' |
| 116 | y -= 1 |
| 117 | except IndexError: |
| 118 | y += 1 |
| 119 | return self.right(matrix, x+1, y, result, stop) |
| 120 | |
| 121 | def spiralOrder(self, matrix): |
| 122 | """ |