This is a programm written in java implementing the MinMax algorithm and the alpha-beta pruning variant. Before you run it make sure to download and import the org.json library.
The program repeatedly prints the following options menu:
-i <filename> : insert tree from file
-j [<filename>] : print tree in the specified filename using JSON format
-d [<filename>] : print tree in the specified filename using DOT format
-c : calculate tree using min-max algorithm
-p : calculate tree using min-max and alpha-beta pruning optimization
-q : quit this program
$>
● -i : The program reads the contents of the file . If the file is read successfully, the message “OK” is printed.
● -c: The MinMax algorithm for the tree is calculated.
● -p: MinMax algorithm with alpha-beta pruning optimization is calculated for the tree.
● -j <filepath>
: Prints to file the contents of the tree in format
JSON. Finally, if the file is written successfully, the message “OK” is printed.
● -d <filepath>
: Prints to file contents of tree in format
suitable for the graphviz suite.Finally, if the file is written successfully, the message “OK” is printed.
● -q: Iiteration stops and the program terminates.
First download the the org.json library. Then compile the file using the command:
javac -cp .:filepath/to/json/file/json-20230227.jar MinMax/MinMax.java
Finaly xecute the program using the command:
java -cp .:filepath/to/json/file/json-20230227.jar MinMax/MinMax