+ return NO_NEWLINE;
+ }
+
+ return OK;
+}
+
+/**
+ * Calculates the intrinsic strategic worth of a point on the board
+ * @param x the x coordinate of the point
+ * @param y the y coordinate of the point
+ * @returns a value between 0 and 1, with 0 indicating worthless and 1 indicating highly desirable
+ * (NOTE: No points will actually be worth 0)
+ */
+double Forfax::IntrinsicWorth(int x, int y) const
+{
+ static double intrinsicWorth[][10][10] =
+ {
+ //Red
+ {
+ {0.1,0.5,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},
+ {0.5,0.5,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},
+ {0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2},
+ {0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3},
+ {0.6,0.6,0.1,0.1,0.65,0.65,0.1,0.1,0.6,0.6},
+ {0.6,0.6,0.1,0.1,0.65,0.65,0.1,0.1,0.6,0.6},
+ {0.6,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.6},
+ {0.6,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.6},
+ {0.6,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.6},
+ {0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7}
+
+
+ },
+ //Blue
+ {
+ {0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7},
+ {0.6,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.6},
+ {0.6,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.6},
+ {0.6,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.6},
+ {0.6,0.6,0.1,0.1,0.65,0.65,0.1,0.1,0.6,0.6},
+ {0.6,0.6,0.1,0.1,0.65,0.65,0.1,0.1,0.6,0.6},
+ {0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3},
+ {0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2},
+ {0.5,0.5,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},
+ {0.1,0.5,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1}
+ }
+ };
+
+ return intrinsicWorth[(int)(colour)][x][y];
+}
+
+/**
+ * Calculates a score assuming that attacker will beat defender, indicating how much killing that piece is worth
+ * @param attacker the Attacking piece
+ * @param defender the Defending piece
+ * @returns a value between 0 and 1, with 0 indicating worthless and 1 indicating highly desirable
+ */
+double Forfax::VictoryScore(Piece * attacker, Piece * defender) const
+{
+
+ //If defender's rank is known, flags or bombs are worth more than usual
+ if (defender->minRank == defender->maxRank)
+ {
+ if (defender->minRank == Piece::FLAG)
+ return 1;
+ else if (defender->minRank == Piece::BOMB)
+ return 0.9;