| 248 | |
| 249 | |
| 250 | class Human: |
| 251 | def __init__(self): |
| 252 | pass |
| 253 | |
| 254 | def set_symbol(self, sym): |
| 255 | self.sym = sym |
| 256 | |
| 257 | def take_action(self, env): |
| 258 | while True: |
| 259 | # break if we make a legal move |
| 260 | move = input("Enter coordinates i,j for your next move (i,j=0..2): ") |
| 261 | i, j = move.split(',') |
| 262 | i = int(i) |
| 263 | j = int(j) |
| 264 | if env.is_empty(i, j): |
| 265 | env.board[i,j] = self.sym |
| 266 | break |
| 267 | |
| 268 | def update(self, env): |
| 269 | pass |
| 270 | |
| 271 | def update_state_history(self, s): |
| 272 | pass |
| 273 | |
| 274 | |
| 275 | # recursive function that will return all |