-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameOnline.py
45 lines (33 loc) · 1.14 KB
/
GameOnline.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
40
41
42
43
44
45
from BoardOnline import BoardOnline
import time
import random
from Minimax import *
from AlphaBeta import *
from Board import Board
from Piece import Piece
from Game import Game
# GAME LINK
# https://cardgames.io/checkers/
def main():
board = BoardOnline()
time.sleep(2)
game_end = False
while not game_end:
(game_board, game_end) = board.get_game_grid()
# FOR DEBUG PURPOSES
board.print_grid(game_board)
# YOUR CODE GOES HERE
# for piece in allPieces:
# pieceRow, pieceColumn = piece.getCurrentPosition()
# board.select_dimension(pieceRow, pieceColumn)
allPieces = Board.getAllPieces(AI_COLOR_STR)
for piece in allPieces:
newBoard = Board.AI_MOVE(3, "AlphaBeta", False)
tempBoard = newBoard[piece.row][piece.column]
board.select_dimension(piece.row, piece.column)
# Insert here the action you want to perform based on the output of the algorithm
# You can use the following function to select a column
# random_column = random.randint(0, 6)
time.sleep(2)
if __name__ == "__main__":
main()