MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / Human

Class Human

rl/tic_tac_toe.py:250–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248
249
250class 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

Callers 1

tic_tac_toe.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected