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

Method take_action

rl/tic_tac_toe.py:257–266  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected