Loading .idea/misc.xml +0 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="JavadocGenerationManager"> <option name="OUTPUT_DIRECTORY" value="$USER_HOME$/Desktop/JavaDoc" /> Loading .idea/workspace.xml +25 −19 Original line number Diff line number Diff line Loading @@ -13,11 +13,13 @@ </component> <component name="ChangeListManager"> <list default="true" id="78671b20-6a1e-42c8-be28-50b7f38fa7ff" name="Default Changelist" comment=""> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/Brain/Board.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/Brain/Board.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/Brain/Brain.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/Brain/Brain.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/Board.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/Board.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/Brain.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/Brain.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/LazyBrain.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/LazyBrain.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/CircleColor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/CircleColor.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SelfAwareCircle.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SelfAwareCircle.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/sge.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java" afterDir="false" /> </list> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> Loading Loading @@ -46,20 +48,22 @@ <option name="hideEmptyMiddlePackages" value="true" /> <option name="showLibraryContents" value="true" /> </component> <component name="PropertiesComponent"><![CDATA[{ "keyToString": { "WebServerToolWindowFactoryState": "false", "node.js.detected.package.eslint": "true", "node.js.detected.package.tslint": "true", "node.js.selected.package.eslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)", "project.structure.last.edited": "Project", "project.structure.proportion": "0.0", "project.structure.side.proportion": "0.36091954", "run.code.analysis.last.selected.profile": "pProject Default", "vue.rearranger.settings.migration": "true" <component name="PropertiesComponent">{ "keyToString": { "RunOnceActivity.OpenProjectViewOnStart": "true", "RunOnceActivity.ShowReadmeOnStart": "true", "WebServerToolWindowFactoryState": "false", "node.js.detected.package.eslint": "true", "node.js.detected.package.tslint": "true", "node.js.selected.package.eslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)", "project.structure.last.edited": "Project", "project.structure.proportion": "0.0", "project.structure.side.proportion": "0.36091954", "run.code.analysis.last.selected.profile": "pProject Default", "vue.rearranger.settings.migration": "true" } }]]></component> }</component> <component name="RecentsManager"> <key name="MoveMembersDialog.RECENTS_KEY"> <recent name="edu.bu.ec504.spr24.Brain.LazyBrain.Board" /> Loading Loading @@ -96,6 +100,8 @@ <workItem from="1580056843261" duration="23542000" /> <workItem from="1706041955741" duration="38000" /> <workItem from="1706042051986" duration="6820000" /> <workItem from="1706057188033" duration="218000" /> <workItem from="1706070762735" duration="2123000" /> </task> <task id="LOCAL-00001" summary="Apparently working version."> <created>1580084914114</created> Loading Loading @@ -170,12 +176,12 @@ <breakpoints> <line-breakpoint enabled="true" type="java-line"> <url>file://$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java</url> <line>658</line> <line>697</line> <option name="timeStamp" value="1" /> </line-breakpoint> <line-breakpoint enabled="true" type="java-line"> <url>file://$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java</url> <line>169</line> <line>208</line> <option name="timeStamp" value="3" /> </line-breakpoint> </breakpoints> Loading src/edu/bu/ec504/spr24/brain/Board.java +8 −2 Original line number Diff line number Diff line Loading @@ -174,10 +174,12 @@ class Board { return data.get(xx).size(); } /** * @return a "pretty-printed" version of the data structure */ public String print() { @Override public String toString() { String temp = data.toString(); return temp.replace("], [", "]\n["); } Loading @@ -186,7 +188,6 @@ class Board { * Stores an (xx,yy) position on the board. */ static class Pos { final int xx; final int yy; Loading @@ -194,5 +195,10 @@ class Board { this.xx = xx; this.yy = yy; } @Override public String toString() { return "[" + xx + ", " + yy +']'; } } } src/edu/bu/ec504/spr24/brain/LazyBrain.java +7 −6 Original line number Diff line number Diff line Loading @@ -59,9 +59,12 @@ public class LazyBrain extends Brain { for (int yy = 0; yy < currBoard.rows(xx); yy++) { if (currStateCopy.getAt(xx, yy) != CircleColor.NONE) { Board test = new Board(currStateCopy); currStateCopy.clickNodeHelper(xx, yy, test.getAt(xx, yy)); // mark all other nodes in the region as "clear" (but does not delete anything) int count = test.clickNode(xx, yy); // try removing the region to see what is left over // mark all other nodes in the region as "clear" (but does not delete anything) currStateCopy.clickNodeHelper(xx, yy, test.getAt(xx, yy)); // try removing the region to see what is left over int count = test.clickNode(xx, yy); if (count > max) { // record a new best move max = count; Loading @@ -71,10 +74,8 @@ public class LazyBrain extends Brain { } } // register the selected move on the board currBoard.clickNode(bestPos.xx, bestPos.yy); // convert bestPos to GUI coordinates bestPos = new Board.Pos(bestPos.yy, myGUI.boardHeight() - 1 - bestPos.yy); bestPos = new Board.Pos(bestPos.xx, myGUI.boardHeight() - 1 - bestPos.yy); // return the result to the GUI return bestPos; Loading src/edu/bu/ec504/spr24/sameGameTris/CircleColor.java +3 −3 Original line number Diff line number Diff line Loading @@ -32,11 +32,11 @@ public enum CircleColor { * Generate a random color from the first num possible colors (excluding NONE) */ static CircleColor randColor() { if (SameGameTris.numColors < 1 || SameGameTris.numColors >= CircleColor.values().length) if (SameGameTris.NUM_COLORS < 1 || SameGameTris.NUM_COLORS >= CircleColor.values().length) throw new IndexOutOfBoundsException("Only " + CircleColor.values().length + " colors are available. You requested choosing one of " + SameGameTris.numColors + " colors."); + " colors are available. You requested choosing one of " + SameGameTris.NUM_COLORS + " colors."); int randNum = 1 + Math.abs(randGen.nextInt()) % SameGameTris.numColors; int randNum = 1 + Math.abs(randGen.nextInt()) % SameGameTris.NUM_COLORS; return CircleColor.values()[randNum]; } } Loading
.idea/misc.xml +0 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="JavadocGenerationManager"> <option name="OUTPUT_DIRECTORY" value="$USER_HOME$/Desktop/JavaDoc" /> Loading
.idea/workspace.xml +25 −19 Original line number Diff line number Diff line Loading @@ -13,11 +13,13 @@ </component> <component name="ChangeListManager"> <list default="true" id="78671b20-6a1e-42c8-be28-50b7f38fa7ff" name="Default Changelist" comment=""> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/Brain/Board.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/Brain/Board.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/Brain/Brain.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/Brain/Brain.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/Board.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/Board.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/Brain.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/Brain.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/LazyBrain.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/brain/LazyBrain.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/CircleColor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/CircleColor.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SelfAwareCircle.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SelfAwareCircle.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/sge.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java" afterDir="false" /> </list> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> Loading Loading @@ -46,20 +48,22 @@ <option name="hideEmptyMiddlePackages" value="true" /> <option name="showLibraryContents" value="true" /> </component> <component name="PropertiesComponent"><![CDATA[{ "keyToString": { "WebServerToolWindowFactoryState": "false", "node.js.detected.package.eslint": "true", "node.js.detected.package.tslint": "true", "node.js.selected.package.eslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)", "project.structure.last.edited": "Project", "project.structure.proportion": "0.0", "project.structure.side.proportion": "0.36091954", "run.code.analysis.last.selected.profile": "pProject Default", "vue.rearranger.settings.migration": "true" <component name="PropertiesComponent">{ "keyToString": { "RunOnceActivity.OpenProjectViewOnStart": "true", "RunOnceActivity.ShowReadmeOnStart": "true", "WebServerToolWindowFactoryState": "false", "node.js.detected.package.eslint": "true", "node.js.detected.package.tslint": "true", "node.js.selected.package.eslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)", "project.structure.last.edited": "Project", "project.structure.proportion": "0.0", "project.structure.side.proportion": "0.36091954", "run.code.analysis.last.selected.profile": "pProject Default", "vue.rearranger.settings.migration": "true" } }]]></component> }</component> <component name="RecentsManager"> <key name="MoveMembersDialog.RECENTS_KEY"> <recent name="edu.bu.ec504.spr24.Brain.LazyBrain.Board" /> Loading Loading @@ -96,6 +100,8 @@ <workItem from="1580056843261" duration="23542000" /> <workItem from="1706041955741" duration="38000" /> <workItem from="1706042051986" duration="6820000" /> <workItem from="1706057188033" duration="218000" /> <workItem from="1706070762735" duration="2123000" /> </task> <task id="LOCAL-00001" summary="Apparently working version."> <created>1580084914114</created> Loading Loading @@ -170,12 +176,12 @@ <breakpoints> <line-breakpoint enabled="true" type="java-line"> <url>file://$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java</url> <line>658</line> <line>697</line> <option name="timeStamp" value="1" /> </line-breakpoint> <line-breakpoint enabled="true" type="java-line"> <url>file://$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java</url> <line>169</line> <line>208</line> <option name="timeStamp" value="3" /> </line-breakpoint> </breakpoints> Loading
src/edu/bu/ec504/spr24/brain/Board.java +8 −2 Original line number Diff line number Diff line Loading @@ -174,10 +174,12 @@ class Board { return data.get(xx).size(); } /** * @return a "pretty-printed" version of the data structure */ public String print() { @Override public String toString() { String temp = data.toString(); return temp.replace("], [", "]\n["); } Loading @@ -186,7 +188,6 @@ class Board { * Stores an (xx,yy) position on the board. */ static class Pos { final int xx; final int yy; Loading @@ -194,5 +195,10 @@ class Board { this.xx = xx; this.yy = yy; } @Override public String toString() { return "[" + xx + ", " + yy +']'; } } }
src/edu/bu/ec504/spr24/brain/LazyBrain.java +7 −6 Original line number Diff line number Diff line Loading @@ -59,9 +59,12 @@ public class LazyBrain extends Brain { for (int yy = 0; yy < currBoard.rows(xx); yy++) { if (currStateCopy.getAt(xx, yy) != CircleColor.NONE) { Board test = new Board(currStateCopy); currStateCopy.clickNodeHelper(xx, yy, test.getAt(xx, yy)); // mark all other nodes in the region as "clear" (but does not delete anything) int count = test.clickNode(xx, yy); // try removing the region to see what is left over // mark all other nodes in the region as "clear" (but does not delete anything) currStateCopy.clickNodeHelper(xx, yy, test.getAt(xx, yy)); // try removing the region to see what is left over int count = test.clickNode(xx, yy); if (count > max) { // record a new best move max = count; Loading @@ -71,10 +74,8 @@ public class LazyBrain extends Brain { } } // register the selected move on the board currBoard.clickNode(bestPos.xx, bestPos.yy); // convert bestPos to GUI coordinates bestPos = new Board.Pos(bestPos.yy, myGUI.boardHeight() - 1 - bestPos.yy); bestPos = new Board.Pos(bestPos.xx, myGUI.boardHeight() - 1 - bestPos.yy); // return the result to the GUI return bestPos; Loading
src/edu/bu/ec504/spr24/sameGameTris/CircleColor.java +3 −3 Original line number Diff line number Diff line Loading @@ -32,11 +32,11 @@ public enum CircleColor { * Generate a random color from the first num possible colors (excluding NONE) */ static CircleColor randColor() { if (SameGameTris.numColors < 1 || SameGameTris.numColors >= CircleColor.values().length) if (SameGameTris.NUM_COLORS < 1 || SameGameTris.NUM_COLORS >= CircleColor.values().length) throw new IndexOutOfBoundsException("Only " + CircleColor.values().length + " colors are available. You requested choosing one of " + SameGameTris.numColors + " colors."); + " colors are available. You requested choosing one of " + SameGameTris.NUM_COLORS + " colors."); int randNum = 1 + Math.abs(randGen.nextInt()) % SameGameTris.numColors; int randNum = 1 + Math.abs(randGen.nextInt()) % SameGameTris.NUM_COLORS; return CircleColor.values()[randNum]; } }