Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. dataPartie = []
  2. iteration = 0
  3. longeur = 400
  4. listeDepart = []
  5. def fctMaxime():
  6. global iteration
  7. global dataPartie
  8. global longeur
  9. global listeDepart
  10. if getGames() == 0:
  11. listeDepart = [choice([0, 1, 2]) for i in range(longeur)]
  12. return 2
  13. else:
  14. if getGames()%1000==0 and dataPartie.count(1)>dataPartie.count(0):
  15. longeur+=10
  16. listeDepart = [choice([0, 1, 2]) for i in range(longeur)]
  17. dataPartie.append(getLastWinneur())
  18. if len(dataPartie) > len(listeDepart):
  19. dataPartie = dataPartie[-len(listeDepart):]
  20. prediction = listeDepart[getGames() % len(listeDepart)]
  21. if getGames() % 50 == 0 and dataPartie.count(0) < dataPartie.count(1):
  22. iteration = (iteration + 1) % 3
  23. if iteration == 1:
  24. prediction = (((prediction + 1) % 3) + 1) % 3
  25. elif iteration == 2:
  26. prediction = (((((((prediction + 1) % 3) + 1) % 3) + 1) % 3) + 1) % 3
  27. return prediction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement