Commit 8afa7385 authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

lint

parent bcf39c7e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,4 +7,4 @@ Simple Brain 15 10 1781
hoooodnbjeijohgjg	15	10	1761
	15	10	1215
Greedy Brain	15	10	1078
Greedy Brain	15	10	91
Greedy Brain	15	10	184
+2 −2
Original line number Diff line number Diff line
package edu.bu.ec504.spr19.samegame.Brain;
package edu.bu.ec504.spr19.Brain;

import edu.bu.ec504.spr19.samegame.GUI;
import edu.bu.ec504.spr19.sameGame.GUI;

/*
 * The Brain is the artificial intelligence that tries to come up with the
+7 −6
Original line number Diff line number Diff line
package edu.bu.ec504.spr19.samegame.Brain;
package edu.bu.ec504.spr19.Brain;

import java.util.LinkedList;
import java.util.Objects;

import edu.bu.ec504.spr19.samegame.GUI;
import edu.bu.ec504.spr19.samegame.CircleColor;
import edu.bu.ec504.spr19.sameGame.GUI;
import edu.bu.ec504.spr19.sameGame.CircleColor;


public class lazyBrain extends Brain {
@@ -156,12 +157,12 @@ public class lazyBrain extends Brain {
			// ... delete all cells with no color
			// ... delete from the end to the front so that there are no problems with re-indexing
			for (int ii=data.size()-1; ii>=0; ii--) {
				for (int jj=get(ii).size()-1; jj>=0; jj--)
				for (int jj = Objects.requireNonNull(get(ii)).size()-1; jj>=0; jj--)
					if (get(ii,jj)==CircleColor.NONE)
						delete(ii, jj);

				// ... delete the column if it is empty
				if (get(ii).size()==0)
				if (Objects.requireNonNull(get(ii)).size()==0)
					delete(ii);
			}

@@ -217,7 +218,7 @@ public class lazyBrain extends Brain {

	// internal methods
	/**
	 * Chooses the next move to make
	 * Chooses the next move to make.
	 * @return the move chosen, in GUI coordinates
	 */
	private pos chooseMove() {
+2 −2
Original line number Diff line number Diff line
package edu.bu.ec504.spr19.samegame.Brain;
package edu.bu.ec504.spr19.Brain;

import edu.bu.ec504.spr19.samegame.GUI;
import edu.bu.ec504.spr19.sameGame.GUI;


/*
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ import java.util.TreeSet;
public class highScore {

	// constants
	public final int maxScores = 10; // the maximum number of scores to display (and remember)
	private final int maxScores = 10; // the maximum number of scores to display (and remember)

	// fields
	/*
@@ -47,7 +47,7 @@ public class highScore {
		/* 
		 * Computes the weighted score from an HS item
		 */
		public static final int weightedScore(HSdata item) {
		public static int weightedScore(HSdata item) {
			final int totalSize = Math.max(item.boardSizeX,item.boardSizeY);
			return (int) (item.score/Math.sqrt(totalSize));
		}
Loading