diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-12-04 15:50:07 -0500 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-12-04 15:50:07 -0500 |
commit | ad70213a1a01b758b850ab37267c21e52d2a5e40 (patch) | |
tree | 6f5081b2278b65804faf2b2e859fd0d49f22bfe1 /src/main/java/me/Danker/gui/PuzzleSolversGui.java | |
parent | 8c16ffbba58226ded7bf84449caca98ecf48147c (diff) | |
download | SkyblockMod-ad70213a1a01b758b850ab37267c21e52d2a5e40.tar.gz SkyblockMod-ad70213a1a01b758b850ab37267c21e52d2a5e40.tar.bz2 SkyblockMod-ad70213a1a01b758b850ab37267c21e52d2a5e40.zip |
Add Tic Tac Toe puzzle solver
Uses minimax to find best move
Diffstat (limited to 'src/main/java/me/Danker/gui/PuzzleSolversGui.java')
-rw-r--r-- | src/main/java/me/Danker/gui/PuzzleSolversGui.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 059d41d..8701563 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -21,6 +21,7 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton blaze; private GuiButton creeper; private GuiButton water; + private GuiButton ticTacToe; private GuiButton startsWith; private GuiButton selectAll; private GuiButton itemFrameOnSeaLanterns; @@ -52,10 +53,11 @@ public class PuzzleSolversGui extends GuiScreen { blaze = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Blaze Solver: " + Utils.getColouredBoolean(ToggleCommand.blazeToggled)); creeper = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperToggled)); water = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Water Solver: " + Utils.getColouredBoolean(ToggleCommand.waterToggled)); - startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); - selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); + ticTacToe = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Tic Tac Toe Solver: " + Utils.getColouredBoolean(ToggleCommand.ticTacToeToggled)); + startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); // Page 2 - itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); + selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); + itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); switch (page) { case 1: @@ -64,11 +66,12 @@ public class PuzzleSolversGui extends GuiScreen { this.buttonList.add(blaze); this.buttonList.add(creeper); this.buttonList.add(water); + this.buttonList.add(ticTacToe); this.buttonList.add(startsWith); - this.buttonList.add(selectAll); this.buttonList.add(nextPage); break; case 2: + this.buttonList.add(selectAll); this.buttonList.add(itemFrameOnSeaLanterns); this.buttonList.add(backPage); break; @@ -110,6 +113,10 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.waterToggled = !ToggleCommand.waterToggled; ConfigHandler.writeBooleanConfig("toggles", "WaterPuzzle", ToggleCommand.waterToggled); water.displayString = "Water Solver: " + Utils.getColouredBoolean(ToggleCommand.waterToggled); + } else if (button == ticTacToe) { + ToggleCommand.ticTacToeToggled = !ToggleCommand.ticTacToeToggled; + ConfigHandler.writeBooleanConfig("toggles", "TicTacToePuzzle", ToggleCommand.ticTacToeToggled); + ticTacToe.displayString = "Tic Tac Toe Solver: " + Utils.getColouredBoolean(ToggleCommand.ticTacToeToggled); } else if (button == startsWith) { ToggleCommand.startsWithToggled = !ToggleCommand.startsWithToggled; ConfigHandler.writeBooleanConfig("toggles", "StartsWithTerminal", ToggleCommand.startsWithToggled); |