This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean networkParser(int playerColor) { | |
boolean hasLeft,hasRight,hasTop,hasBottom; | |
Piece[] networkTop, networkBottom, networkLeft, networkRight; | |
if (playerColor == 0){ | |
hasTop = false; | |
hasBottom = false; | |
networkTop = new Piece[8]; | |
networkBottom = new Piece[8]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package player; | |
import java.util.ArrayList; | |
public class MyBoard extends Board { | |
private Piece[][] pieces = new Piece[8][8]; | |
private ArrayList<Move> mostRecentMove = new ArrayList<Move>() ; | |
public MyBoard(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package player; | |
import java.util.ArrayList; | |
public abstract class Board{ | |
//returns True if a network exists for a certain player, False otherwise. | |
public abstract boolean networkParser(int playerColor); | |
//Returns True if a move by a certian player is invalid,otherwise returns False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean networkParser(int playerColor) {//returns True if a network exists for a certain player, False otherwise. | |
//find piece on left side and right side | |
boolean hasLeft,hasRight,hasTop,hasBottom; | |
Piece[] networkTop, networkBottom, networkLeft, networkRight; | |
if (playerColor == 0){ | |
hasTop = false; | |
hasBottom = false; | |
networkTop = new Piece[8]; | |
networkBottom = new Piece[8]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package player; | |
import java.util.ArrayList; | |
public class MyBoard extends Board { | |
private Piece[][] pieces = new Piece[8][8]; | |
private ArrayList<Move> mostRecentMove; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean checkInvalidMove(Move m, int playerColor){ | |
if (m.moveKind == 0){ | |
return false; | |
}else if (m.moveKind == 1){ | |
if (numPieces(playerColor) == 10){ | |
return true; | |
}else{ | |
if (isOccupied(m.x1,m.y1)||isInOppGoalOrCorner(m.x1,m.y1,playerColor)||wouldMakeTrio(m.x1,m.y1,playerColor)){ | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package player; | |
public abstract class MyBoard { | |
/** | |
* @param args | |
*/ | |
private Piece[][] pieces = new Piece[8][8]; | |
public boolean isValidMove(Move m){ | |
return false; |