diff options
author | RossTheRoss <mstrapp@protonmail.com> | 2021-04-13 17:22:52 -0500 |
---|---|---|
committer | RossTheRoss <mstrapp@protonmail.com> | 2021-04-13 17:22:52 -0500 |
commit | 77a99164bb53b207ba8efec1a37238379f595f44 (patch) | |
tree | 47f95873e3f005749853efb5d9e2c6f986c077a8 /Not Jack/main.py | |
parent | Rearrange things more I guess (diff) | |
download | csci4511w-77a99164bb53b207ba8efec1a37238379f595f44.tar csci4511w-77a99164bb53b207ba8efec1a37238379f595f44.tar.gz csci4511w-77a99164bb53b207ba8efec1a37238379f595f44.tar.bz2 csci4511w-77a99164bb53b207ba8efec1a37238379f595f44.tar.lz csci4511w-77a99164bb53b207ba8efec1a37238379f595f44.tar.xz csci4511w-77a99164bb53b207ba8efec1a37238379f595f44.tar.zst csci4511w-77a99164bb53b207ba8efec1a37238379f595f44.zip |
Rearrange and add more
Diffstat (limited to '')
-rw-r--r-- | Not Jack/main.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Not Jack/main.py b/Not Jack/main.py new file mode 100644 index 0000000..4e37684 --- /dev/null +++ b/Not Jack/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 = int(input("\nPlease enter the number of plies used by the AI: \n")) + + 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() |