Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. def actions(self, state):
  2. actions = []
  3.  
  4. for i in range(len(state)):
  5. if state[i] == 0:
  6. if state[10] == 0:
  7. actions.append([i, 1])
  8. else:
  9. actions.append([i, 2])
  10. return actions
  11.  
  12. def result(self, state, action):
  13. newstate = list(state)
  14. newstate[action[0]] = action[1]
  15. # count suuruse muutmine state lopus
  16. newstate[9] = newstate[9] + 1
  17. if newstate[10] == 0: newstate[10] = 1
  18. else: newstate[10] == 0
  19. return tuple(newstate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement