Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def actions(self, state):
- actions = []
- for i in range(len(state)):
- if state[i] == 0:
- if state[10] == 0:
- actions.append([i, 1])
- else:
- actions.append([i, 2])
- return actions
- def result(self, state, action):
- newstate = list(state)
- newstate[action[0]] = action[1]
- # count suuruse muutmine state lopus
- newstate[9] = newstate[9] + 1
- if newstate[10] == 0: newstate[10] = 1
- else: newstate[10] == 0
- return tuple(newstate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement