-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
executable file
·39 lines (31 loc) · 925 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from time import sleep
from board import Board
from legalmovechecker import LegalMoveChecker
from player import Player
from deepYellowJ import DeepYellowJ
from ezgraphics import *
def test():
m1 = "D2"
m2 = "D4"
m3 = "H2"
board = Board()
board._window = GraphicsWindow((8-1)*100, (8-1)*100)
board._canvas = board._window.canvas()
board.drawBoard()
board.putPiece("R", "w", m1)
board.putPiece("Q", "b", m3)
board.putPiece("K", "b", "D8")
board.drawPieces()
lC = LegalMoveChecker(board)
dY = DeepYellowJ("w", board)
moves = dY.findMove()
print(moves)
lC.updateBoard(board)
dY.updateBoard(board)
print(lC.isLegalMove(moves[0], moves[1]))
if (lC.isLegalMove(moves[0], moves[1])):
sleep(1)
board.move(moves[0], moves[1])
moves = dY.findAllMoves()
print(moves)
test()