(self, action)
| 71 | return self.rewards.get((self.i, self.j), 0) |
| 72 | |
| 73 | def undo_move(self, action): |
| 74 | # these are the opposite of what U/D/L/R should normally do |
| 75 | if action == 'U': |
| 76 | self.i += 1 |
| 77 | elif action == 'D': |
| 78 | self.i -= 1 |
| 79 | elif action == 'R': |
| 80 | self.j -= 1 |
| 81 | elif action == 'L': |
| 82 | self.j += 1 |
| 83 | # raise an exception if we arrive somewhere we shouldn't be |
| 84 | # should never happen |
| 85 | assert(self.current_state() in self.all_states()) |
| 86 | |
| 87 | def game_over(self): |
| 88 | # returns true if game is over, else false |
nothing calls this directly
no test coverage detected