This projects built to fulfill Tubes IF3170 Intelejensi Buatan
The “Adjacency” program was designed as an interactive and strategic board game that is played between two players. Using X’s and O’s on an 8x8 board outputted on a computer screen, the objective of the game is for a player to get more X’s than O’s in total or vice versa after a specific number of rounds.
The initial game starts with 4 X’s in the bottom left corner and 4 O’s in the top right corner. The first player will begin by placing an X on an empty square (through clicking). In turn, all O’s that are on adjacent squares are then replaced with X’s. Play will continue with the second player taking his turn by placing an O on an empty square. In turn, all X’s that are on adjacent squares are then replaced with O’s.
To get started, please install the latest version of the Java Development Kit (JDK) and please install a Java IDE such as IntelliJ. Please note that the deployment instructions below use IntelliJ as the IDE.
[README.md](README.md) ### Deployment (IntelliJ) 1. Clone the repository through Git by running the following command:
`git clone https://github.com/GAIB20/adversarial-adjacency-strategy-game.git`, or simply download the repository. 2. Open the repository folder through IntelliJ. 3. Set up the JDK by going to File -> Project Structure -> Project tab. In the Project tab, go to Project SDK, click New, and browse to the location of your JDK folder. 4. NOTE: JavaFX has been removed starting from JDK 11, and it is now a standalone module. The JavaFX files needed to set up the Adjacency program are located in the repository folder itself. To set it up, go to File -> Project Structure -> Libraries tab. In the Libraries tab, press the + button, browse to the "javafx-sdk/lib" folder in the repository, and add it to the list of libraries. 5. IMPORTANT: Go to Run -> Edit Configurations, and go to the VM options. In this line, please add in the full path to the lib folder of the javafx-sdk folder on your own computer, and then add the following line
`--add-modules=javafx.controls,javafx.fxml`.
For example, I added the following line to my VM options: `--module-path "C:\Jed's Work\CS Side Projects\Adjacency-Strategy-Game\javafx-sdk\lib" --add-modules=javafx.controls,javafx.fxml` 6. Open the Main class in the IntelliJ file interface.
Seharusnya bisa untuk windows non wsl jg (untested), dengan cara skip poin 2, dan ubah semua /
di command jadi \
- Make sure you have JDK 11 installed
- Clone the repo and cd to the folder
git clone https://github.com/GAIB20/adversarial-adjacency-strategy-game.git
cd adversarial-adjacency-strategy-game
- Download JavaFX linux version
wget https://download2.gluonhq.com/openjfx/11.0.2/openjfx-11.0.2_linux-x64_bin-sdk.zip
unzip openjfx-11.0.2_linux-x64_bin-sdk.zip
mv javafx-sdk-11.0.2 javafx-sdk-linux
- Compile the program
javac -cp ./src --module-path "./javafx-sdk-linux/lib" --add-modules=javafx.controls,javafx.fxml src/*.java
- Run the program
java -cp ./src --module-path "./javafx-sdk-linux/lib" --add-modules=javafx.controls,javafx.fxml Main
- Run the Main class to load the program, and the input window below will pop up. There is two option available that is Player vs Bot and Bot vs Bot. Input the names of Player (X) and/or Bot (O/X) into their respective text fields.
Then, select the algorithm for the bot(s). Then, the number of rounds (a number between 2 and 28) to play using the dropdown menu.
You can make the second player start first.
2. Click Play, and the gameboard and scoreboard window will load. Player (X) starts the game by clicking on an empty button. Any adjacent O’s will change to X's as a result. 3. Then, Bot (O) has their turn by also clicking on an empty button. Any adjacent X’s will change to O's as a result. NOTE: This process is counted as 1 round (Player and Bot both taking their turns). 4. The game will continue until there are no more rounds left to play. In the end, the player with the greater number of letters is the winner of the game.
- Built with JavaFX
- Modified by ITB Graphics and AI Lab Assistant 2020
Nama | NIM | |
---|---|---|
Fajar Maulana Herawan | 13521080 | 13521080@std.stei.itb.ac.id |
Bagas Aryo Seto | 13521081 | 13521081@std.stei.itb.ac.id |
Shidqi Indy Izhari | 13521097 | 13521097@std.stei.itb.ac.id |
Muhammad Rizky Sya'ban | 13521119 | 13521119@std.stei.itb.ac.id |
Project Link: https://github.com/mrsyaban/Tubes-1-AI_AI-AI-AI