Program: 72248
Project: 72248
Buggy source:
private int toLoc(int playerIndex,int direction){
  if (allPlayers[playerIndex].preLoc == 7) {
    if (direction == 7)     return 6;
 else     if (direction == 0)     return 8;
 else     return 24;
  }
 else   if (allPlayers[playerIndex].preLoc == 16) {
    if (direction == 7)     return 15;
 else     return 17;
  }
 else   if (allPlayers[playerIndex].preLoc == 24) {
    if (direction == 7)     return 7;
 else     return 23;
  }
 else   if (allPlayers[playerIndex].preLoc == 23) {
    if (direction == 7)     return 24;
 else     return 22;
  }
 else   if (allPlayers[playerIndex].preLoc == 8) {
    if (direction == 4)     return 7;
 else     return 9;
  }
 else   if (allPlayers[playerIndex].preLoc == 11) {
    if (direction == 7)     return 12;
 else     return 10;
  }
 else   if (allPlayers[playerIndex].preLoc == 12) {
    if (direction == 1)     return 13;
 else     return 11;
  }
 else   if (allPlayers[playerIndex].preLoc == 14) {
    if (direction == 5)     return 13;
 else     return 15;
  }
 else   if (allPlayers[playerIndex].preLoc == 15) {
    if (direction == 7)     return 14;
 else     return 16;
  }
 else   if (allPlayers[playerIndex].preLoc == 16) {
    if (direction == 7)     return 15;
 else     return 17;
  }
 else   if (allPlayers[playerIndex].preLoc == 17) {
    if (direction == 7)     return 16;
 else     return 18;
  }
 else   if (allPlayers[playerIndex].preLoc == 1) {
    if (direction == 3)     return 0;
 else     return 2;
  }
 else   if (allPlayers[playerIndex].preLoc == 0) {
    return 1;
  }
 else {
    if (direction == 1)     return allPlayers[playerIndex].preLoc++;
 else     return allPlayers[playerIndex].preLoc--;
  }
}

Fixed version (ground truth):
private int toLoc(int playerIndex,int direction){
  if (allPlayers[playerIndex].preLoc == 0) {
    return 1;
  }
 else   if (allPlayers[playerIndex].preLoc == 1) {
    if (direction == 3)     return 0;
 else     return 2;
  }
  if (allPlayers[playerIndex].preLoc == 7) {
    if (direction == 7)     return 6;
 else     if (direction == 0)     return 8;
 else     return 24;
  }
 else   if (allPlayers[playerIndex].preLoc == 8) {
    if (direction == 4)     return 7;
 else     return 9;
  }
 else   if (allPlayers[playerIndex].preLoc == 11) {
    if (direction == 7)     return 12;
 else     return 10;
  }
 else   if (allPlayers[playerIndex].preLoc == 12) {
    if (direction == 1)     return 13;
 else     return 11;
  }
 else   if (allPlayers[playerIndex].preLoc == 14) {
    if (direction == 5)     return 13;
 else     return 15;
  }
 else   if (allPlayers[playerIndex].preLoc == 15) {
    if (direction == 7)     return 14;
 else     return 16;
  }
 else   if (allPlayers[playerIndex].preLoc == 16) {
    if (direction == 7)     return 15;
 else     return 17;
  }
 else   if (allPlayers[playerIndex].preLoc == 17) {
    if (direction == 7)     return 16;
 else     return 18;
  }
 else   if (allPlayers[playerIndex].preLoc == 23) {
    if (direction == 7)     return 24;
 else     return 22;
  }
 else   if (allPlayers[playerIndex].preLoc == 24) {
    if (direction == 7)     return 7;
 else     return 23;
  }
 else {
    if (direction == 1)     return allPlayers[playerIndex].preLoc++;
 else     return allPlayers[playerIndex].preLoc--;
  }
}