Exemplo n.º 1
0
if args['log']=='y':
    toLog=True
else:
    toLog=False

if args['seed'] == "":
    val = None

elif args['seed'] != "":
    val = args['seed']


gameboard = board("Red", toLog)

trainee = opponent('Red', seed(None), toLog)
trainer = opponent('Black', seed(val), toLog)

trainer.genPieceProgram()
trainer.genMoveProgram()

trainee.genPieceProgram()
trainee.genMoveProgram()

winStatus =trainGame()

points = score(gameboard.Red, gameboard.Black, winStatus)

print points

Exemplo n.º 2
0
            log('Draw')
            break
        gameLoop = gameboard.win()


parser = argparse.ArgumentParser(description='Input commands.')

parser.add_argument('-color', default='Red', choices=['Red', 'Black'], help='Select a color you wish to play agaisnt the computer r or b')

parser.add_argument('-seed', default='', help='Seed value to generate the opponent')

args = vars(parser.parse_args())

gameboard = board(args['color'], True)

if args['seed'] == "":
    val = None

elif args['seed'] != "":
    val = args['seed']

if args['color']=='Red':
    comp = opponent('Black', seed(val), True)
elif args['color']=='Black':
    comp = opponent('Red', seed(val), True)

comp.genPieceProgram()
comp.genMoveProgram()

playerGame()