Exemplo n.º 1
0
# This entrypoint file to be used in development. Start by reading README.md
from RPS_game import play, mrugesh, abbey, quincy, kris, human, random_player
from RPS import player
from unittest import main

play(player, quincy, 1000)
play(player, abbey, 100)
play(player, kris, 1000)
play(player, mrugesh, 1000)

# Uncomment line below to play interactively against a bot:
# play(human, abbey, 20, verbose=True)

# Uncomment line below to play against a bot that plays randomly:
# play(human, random_player, 1000)



# Uncomment line below to run unit tests automatically
#main(module='test_module', exit=False)
Exemplo n.º 2
0
 def test_player_vs_quincy(self):
     print("Testing game against quincy...")
     actual = play(player, quincy, 1000) >= 60
     self.assertTrue(
         actual,
         'Expected player to defeat quincy at least 60% of the time.')
Exemplo n.º 3
0
# This entrypoint file to be used in development. Start by reading README.md
from RPS_game import play, mrugesh, abbey, quincy, kris, human, random_player
from RPS import player,N,test
from unittest import main
from RPS_game import play, mrugesh, abbey, quincy, kris, human, random_player

from modele import trainfunc,step
P=int(5*N/6)
if test:
  #for i in range(0, N)  :    
    print("*******************************")
    #print(i)
    if True:
    #if i<N/4:
      play(player, quincy, int(N/4),verbose=not test)      
    #elif i<2*N/4:
      play(player, abbey,  int(N/4),verbose=not test)
    #elif i<3*N/4:
      play(player, kris, int(N/4),verbose=not test)
    #else:
      play(player, mrugesh, int(N/4),verbose=not test)
      from RPS import opponent_history,my_history
      trainfunc(my_history[0:P],opponent_history[0:P],my_history[P:],opponent_history[P:])
else:
  play(player, quincy, N)
  play(player, abbey, N)
  play(player, kris, N)
  play(player, mrugesh, N)
# Uncomment line below to play interactively against a bot:
# play(human, abbey, 20, verbose=True)
Exemplo n.º 4
0
 def test_player_vs_kris(self):
     print("Testing game against kris...")
     actual = play(player, kris, 1000) >= 60
     self.assertTrue(
         actual, 'Expected player to defeat kris at least 60% of the time.')
Exemplo n.º 5
0
 def test_player_vs_mrugesh(self):
     print("Testing game against mrugesh...")
     actual = play(player, mrugesh, 1000) >= 60
     self.assertTrue(
         actual,
         'Expected player to defeat mrugesh at least 60% of the time.')
Exemplo n.º 6
0
from RPS_game import play, mrugesh, abbey, quincy, kris, human, random_player
from RPS import player
from unittest import main

games = 1000
play(player, quincy, games)
play(player, abbey, games)
play(player, kris, games)
play(player, mrugesh, games)

# play(player, human, games)

# play(human, abbey, 20, verbose=True)
# play(human, random_player, 1000)
# main(module='test_module', exit=False)
Exemplo n.º 7
0
# This entrypoint file to be used in development. Start by reading README.md
from RPS_game import play, mrugesh, abbey, quincy, kris, human, random_player
from RPS import player
from unittest import main

#play(player, quincy, 1000)
#play(player, abbey, 1000)
#play(player, kris, 1000)
#play(player, mrugesh, 1000)

# Uncomment line below to play interactively against a bot:
#play(human, abbey, 20, verbose=True)

# Uncomment line below to play against a bot that plays randomly:
play(player, random_player, 1000)

# Uncomment line below to run unit tests automatically
#main(module='test_module', exit=False)
# This entrypoint file to be used in development. Start by reading README.md
from RPS_game import play, mrugesh, abbey, quincy, kris, human, random_player
from RPS import player
from unittest import main

print("--------- you vs quincy ----------")
play(player, quincy, 1000, verbose=False)

print("--------- you vs abbey ----------")
play(player, abbey, 10000, verbose=False)

print("--------- you vs kris ----------")
play(player, kris, 10000)

print("--------- you vs mrugesh ----------")
play(player, mrugesh, 1000)

# Uncomment line below to play interactively against a bot:
# play(human, abbey, 20, verbose=True)

# Uncomment line below to play against a bot that plays randomly:
# play(human, random_player, 1000)

# Uncomment line below to run unit tests automatically
# main(module='test_module', exit=False)
Exemplo n.º 9
0
 def test_player_vs_abbey(self):
     print("Testing game against abbey...")
     actual = play(player, abbey, 1000) >= 60
     self.assertTrue(
         actual, "Expected player to defeat abbey at least 60% of the time."
     )
Exemplo n.º 10
0
#AUTHOR : HAMORA HADI

# This entrypoint file to be used in development. Start by reading README.md
from RPS_game import play, mrugesh, abbey, quincy, kris, human, random_player
from RPS import player
from unittest import main

play(player, quincy, 1000)
play(player, abbey, 1000)
play(player, kris, 1000)
play(player, mrugesh, 1000)

# Uncomment line below to play interactively against a bot:
play(human, abbey, 20, verbose=True)

# Uncomment line below to play against a bot that plays randomly:
# play(human, random_player, 1000)

# Uncomment line below to run unit tests automatically
# main(module='test_module', exit=False)
Exemplo n.º 11
0
# This entrypoint file to be used in development. Start by reading README.md
from RPS_game import play, mrugesh, abbey, quincy, kris, human, random_player
from RPS import player
from unittest import main

# this player always returns a 'P'
def poor(prev_play):
    return 'P'

import random    
def poor2(prev_opponent_play):
    return random.choice(['R', 'P'])

#play(player, quincy, 1000) 
#play(player, abbey, 1000)
#play(player, kris, 1000)
#play(player, mrugesh, 1000)
play(player, poor, 1000) # always the same

# Uncomment line below to play interactively against a bot:
#play(human, mrugesh, 20, verbose=True)

# Uncomment line below to play against a bot that plays randomly:
# play(human, random_player, 1000)



# Uncomment line below to run unit tests automatically
# main(module='test_module', exit=False)
Exemplo n.º 12
0
# This entrypoint file to be used in development. Start by reading README.md
from RPS_game import play, mrugesh, abbey, quincy, kris, human, random_player
from RPS import player
from unittest import main

play(player, quincy, 1000)
play(player, abbey, 1000)
play(player, kris, 1000)
play(player, mrugesh, 1000)

# Uncomment line below to play interactively against a bot:
# play(human, abbey, 20, verbose=True)

# Uncomment line below to play against a bot that plays randomly:
play(human, random_player, 1000)

# Uncomment line below to run unit tests automatically
# main(module='test_module', exit=False)