From 9450dce6e461e8942da1dc694ddf87f22a75f630 Mon Sep 17 00:00:00 2001 From: vehme003 Date: Mon, 26 Apr 2021 12:45:09 -0500 Subject: Add files via upload --- main.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..6a123e1 --- /dev/null +++ b/main.py @@ -0,0 +1,40 @@ +from Algorithm import * +from DotsNBoxes import * +from Board import * +from Nodes import * + +def main(): + while True: + + print("\t\t!! Welcome to the game of Dots and Boxes !!\n\n Be prepared to be crushed by the power of Artificial Intelligence ... !!\n\n\ + Kidding! You totally can beat it!\n\n\n") + + x = input("Press 1 to start the game or press 2 to escape from the inevitable doom!!\n\n") + if x == "1": + + Board_Xdim = int(input("\nPlease enter the number of rows for the board: \n")) * 2 + 1 + + if Board_Xdim < 5: + print("\nthe number of rows should atleast be 2\n") + exit() + + Board_Ydim = int(input("\nPlease enter the number of columns for the board: \n")) * 2 + 1 + + if Board_Ydim < 5: + print("\nthe number of columns should atleast be 2\n") + exit() + + Ply_num = 2 + Ply_num2 = 3 + if Ply_num < 2: + print("\nThe number of plies should be higher than 1\n") + exit() + + Match = DotsNBoxes(Board_Xdim, Board_Ydim, Ply_num) + Match.start() + else: + print ("\n\nEscape it is!") + exit() + +if __name__ == "__main__": + main() \ No newline at end of file -- cgit v1.2.3