Commit 1b349e32 authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

Merge branch 'master' into 'master'

Bug fixes

See merge request ec504/ec504_admin/homework-zero-problem-4!1
parents d5fc6137 1591e742
Loading
Loading
Loading
Loading
+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" />
+25 −19
Original line number Diff line number Diff line
@@ -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" />
@@ -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">{
  &quot;keyToString&quot;: {
    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
    &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
    &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
    &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
    &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
    &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
    &quot;project.structure.last.edited&quot;: &quot;Project&quot;,
    &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
    &quot;project.structure.side.proportion&quot;: &quot;0.36091954&quot;,
    &quot;run.code.analysis.last.selected.profile&quot;: &quot;pProject Default&quot;,
    &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
  }
}]]></component>
}</component>
  <component name="RecentsManager">
    <key name="MoveMembersDialog.RECENTS_KEY">
      <recent name="edu.bu.ec504.spr24.Brain.LazyBrain.Board" />
@@ -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>
@@ -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>
+8 −2
Original line number Diff line number Diff line
@@ -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[");
  }
@@ -186,7 +188,6 @@ class Board {
   * Stores an (xx,yy) position on the board.
   */
  static class Pos {

    final int xx;
    final int yy;

@@ -194,5 +195,10 @@ class Board {
      this.xx = xx;
      this.yy = yy;
    }

    @Override
    public String toString() {
      return "[" + xx + ", " + yy +']';
    }
  }
}
+7 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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;
+3 −3
Original line number Diff line number Diff line
@@ -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