Loading .idea/workspace.xml +28 −26 Original line number Diff line number Diff line Loading @@ -13,12 +13,7 @@ </component> <component name="ChangeListManager"> <list default="true" id="78671b20-6a1e-42c8-be28-50b7f38fa7ff" name="Default Changelist" comment=""> <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/SameGameTris.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java" afterDir="false" /> </list> <option name="SHOW_DIALOG" value="false" /> Loading Loading @@ -48,22 +43,26 @@ <option name="hideEmptyMiddlePackages" value="true" /> <option name="showLibraryContents" value="true" /> </component> <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 name="PropertiesComponent"><![CDATA[{ "keyToString": { "Application.EC504 SameGameTris.executor": "Debug", "RunOnceActivity.OpenProjectViewOnStart": "true", "RunOnceActivity.ShowReadmeOnStart": "true", "WebServerToolWindowFactoryState": "false", "kotlin-language-version-configured": "true", "node.js.detected.package.eslint": "true", "node.js.detected.package.tslint": "true", "node.js.selected.package.eslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)", "nodejs_package_manager_path": "npm", "project.structure.last.edited": "Project", "project.structure.proportion": "0.0", "project.structure.side.proportion": "0.36091954", "run.code.analysis.last.selected.profile": "pProject Default", "settings.editor.selected.configurable": "preferences.lookFeel", "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 @@ -85,6 +84,13 @@ </method> </configuration> </component> <component name="SharedIndexes"> <attachedChunks> <set> <option value="jdk-17.0.10-corretto-17.0.10-f644763e9732-24582b8d" /> </set> </attachedChunks> </component> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SvnConfiguration"> <configuration /> Loading @@ -102,6 +108,7 @@ <workItem from="1706042051986" duration="6820000" /> <workItem from="1706057188033" duration="218000" /> <workItem from="1706070762735" duration="2123000" /> <workItem from="1706112889389" duration="1257000" /> </task> <task id="LOCAL-00001" summary="Apparently working version."> <created>1580084914114</created> Loading Loading @@ -176,14 +183,9 @@ <breakpoints> <line-breakpoint enabled="true" type="java-line"> <url>file://$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java</url> <line>697</line> <line>143</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>208</line> <option name="timeStamp" value="3" /> </line-breakpoint> </breakpoints> </breakpoint-manager> </component> Loading src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java +21 −8 Original line number Diff line number Diff line Loading @@ -6,6 +6,8 @@ import java.awt.GridLayout; import java.awt.event.*; import java.io.Serial; import java.util.Random; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; Loading Loading @@ -262,17 +264,28 @@ public class SameGameTris extends GUI implements ActionListener, ItemListener { /* * "Clicks" on the circle at location (xx,yy) */ @Override public void makeMove(int xx, int yy) { circles[xx][yy].mouseEntered(null); // pretend the mouse was pressed at location (xx,yy) try { Thread.sleep(DISPLAY_TIME_MS); // wait a bit for the user to register the move } catch (InterruptedException ignored) { } Timer t = new Timer(); TimerTask tt = new TimerTask() { @Override public void run() { circles[xx][yy].mouseExited(null); circles[xx][yy].mousePressed(null); circles[xx][yy].mouseReleased( null); // pretend that the mouse button was released at the location synchronized(brainThread) { brainThread.notify(); // restart thinking } } }; t.schedule(tt, DISPLAY_TIME_MS); synchronized(brainThread) { try { brainThread.wait(); // pause thinking between moves } catch (InterruptedException ignored) {} } } /** Loading Loading
.idea/workspace.xml +28 −26 Original line number Diff line number Diff line Loading @@ -13,12 +13,7 @@ </component> <component name="ChangeListManager"> <list default="true" id="78671b20-6a1e-42c8-be28-50b7f38fa7ff" name="Default Changelist" comment=""> <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/SameGameTris.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java" afterDir="false" /> </list> <option name="SHOW_DIALOG" value="false" /> Loading Loading @@ -48,22 +43,26 @@ <option name="hideEmptyMiddlePackages" value="true" /> <option name="showLibraryContents" value="true" /> </component> <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 name="PropertiesComponent"><![CDATA[{ "keyToString": { "Application.EC504 SameGameTris.executor": "Debug", "RunOnceActivity.OpenProjectViewOnStart": "true", "RunOnceActivity.ShowReadmeOnStart": "true", "WebServerToolWindowFactoryState": "false", "kotlin-language-version-configured": "true", "node.js.detected.package.eslint": "true", "node.js.detected.package.tslint": "true", "node.js.selected.package.eslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)", "nodejs_package_manager_path": "npm", "project.structure.last.edited": "Project", "project.structure.proportion": "0.0", "project.structure.side.proportion": "0.36091954", "run.code.analysis.last.selected.profile": "pProject Default", "settings.editor.selected.configurable": "preferences.lookFeel", "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 @@ -85,6 +84,13 @@ </method> </configuration> </component> <component name="SharedIndexes"> <attachedChunks> <set> <option value="jdk-17.0.10-corretto-17.0.10-f644763e9732-24582b8d" /> </set> </attachedChunks> </component> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SvnConfiguration"> <configuration /> Loading @@ -102,6 +108,7 @@ <workItem from="1706042051986" duration="6820000" /> <workItem from="1706057188033" duration="218000" /> <workItem from="1706070762735" duration="2123000" /> <workItem from="1706112889389" duration="1257000" /> </task> <task id="LOCAL-00001" summary="Apparently working version."> <created>1580084914114</created> Loading Loading @@ -176,14 +183,9 @@ <breakpoints> <line-breakpoint enabled="true" type="java-line"> <url>file://$PROJECT_DIR$/src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java</url> <line>697</line> <line>143</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>208</line> <option name="timeStamp" value="3" /> </line-breakpoint> </breakpoints> </breakpoint-manager> </component> Loading
src/edu/bu/ec504/spr24/sameGameTris/SameGameTris.java +21 −8 Original line number Diff line number Diff line Loading @@ -6,6 +6,8 @@ import java.awt.GridLayout; import java.awt.event.*; import java.io.Serial; import java.util.Random; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; Loading Loading @@ -262,17 +264,28 @@ public class SameGameTris extends GUI implements ActionListener, ItemListener { /* * "Clicks" on the circle at location (xx,yy) */ @Override public void makeMove(int xx, int yy) { circles[xx][yy].mouseEntered(null); // pretend the mouse was pressed at location (xx,yy) try { Thread.sleep(DISPLAY_TIME_MS); // wait a bit for the user to register the move } catch (InterruptedException ignored) { } Timer t = new Timer(); TimerTask tt = new TimerTask() { @Override public void run() { circles[xx][yy].mouseExited(null); circles[xx][yy].mousePressed(null); circles[xx][yy].mouseReleased( null); // pretend that the mouse button was released at the location synchronized(brainThread) { brainThread.notify(); // restart thinking } } }; t.schedule(tt, DISPLAY_TIME_MS); synchronized(brainThread) { try { brainThread.wait(); // pause thinking between moves } catch (InterruptedException ignored) {} } } /** Loading