|  | @@ -150,7 +150,7 @@ void Game::parseMove(const String& input, String& output) {
 | 
	
		
			
				|  |  |      print(output);
 | 
	
		
			
				|  |  |      output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\r");
 | 
	
		
			
				|  |  |      print(output);
 | 
	
		
			
				|  |  | -    if(removed && isAnotherTurnPossible()) {
 | 
	
		
			
				|  |  | +    if(removed && isAnotherTurnPossible(BLACK)) {
 | 
	
		
			
				|  |  |          state = ANOTHER_MOVE;
 | 
	
		
			
				|  |  |          output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\rselect location to move: ");
 | 
	
		
			
				|  |  |          return;
 | 
	
	
		
			
				|  | @@ -165,7 +165,7 @@ void Game::parseMove(const String& input, String& output) {
 | 
	
		
			
				|  |  |  void Game::parseAnotherMove(const String& input, String& output) {
 | 
	
		
			
				|  |  |      int x;
 | 
	
		
			
				|  |  |      int y;
 | 
	
		
			
				|  |  | -    if(parseLocation(input, x, y) || !canMoveActiveStoneTo(x - activeX, y - activeY)) {
 | 
	
		
			
				|  |  | +    if(parseLocation(input, x, y) || !canMoveActiveStoneTo(x - activeX, y - activeY, BLACK)) {
 | 
	
		
			
				|  |  |          output.append("invalid move location.\n\r");
 | 
	
		
			
				|  |  |          print(output);
 | 
	
		
			
				|  |  |          output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\rselect location to move: ");
 | 
	
	
		
			
				|  | @@ -190,7 +190,7 @@ void Game::parseAnotherMove(const String& input, String& output) {
 | 
	
		
			
				|  |  |      print(output);
 | 
	
		
			
				|  |  |      output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\r");
 | 
	
		
			
				|  |  |      print(output);
 | 
	
		
			
				|  |  | -    if(removed && isAnotherTurnPossible()) {
 | 
	
		
			
				|  |  | +    if(removed && isAnotherTurnPossible(BLACK)) {
 | 
	
		
			
				|  |  |          output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\rselect location to move: ");
 | 
	
		
			
				|  |  |          return;
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -224,7 +224,7 @@ void Game::parseRemoveSelection(const String& input, String& output) {
 | 
	
		
			
				|  |  |      activeX = mx;
 | 
	
		
			
				|  |  |      activeY = my;
 | 
	
		
			
				|  |  |      print(output);
 | 
	
		
			
				|  |  | -    if(isAnotherTurnPossible()) {
 | 
	
		
			
				|  |  | +    if(isAnotherTurnPossible(BLACK)) {
 | 
	
		
			
				|  |  |          state = ANOTHER_MOVE;
 | 
	
		
			
				|  |  |          output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\rselect location to move: ");
 | 
	
		
			
				|  |  |          return;
 | 
	
	
		
			
				|  | @@ -338,11 +338,12 @@ void Game::botMove(String& output) {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      lastLocation = 0;
 | 
	
		
			
				|  |  | -    bool removed = true;
 | 
	
		
			
				|  |  | -    while(removed) {
 | 
	
		
			
				|  |  | +    while(rank != -1) {
 | 
	
		
			
				|  |  |          fields[from.x][from.y] = EMPTY;
 | 
	
		
			
				|  |  |          fields[to.x][to.y] = BLACK;
 | 
	
		
			
				|  |  | -        removed = removeLine(takeFrom.x, takeFrom.y, takeTo.x, takeTo.y, WHITE);
 | 
	
		
			
				|  |  | +        if(!removeLine(takeFrom.x, takeFrom.y, takeTo.x, takeTo.y, WHITE)) {
 | 
	
		
			
				|  |  | +            break;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          activeX = to.x;
 | 
	
		
			
				|  |  |          activeY = to.y;
 | 
	
	
		
			
				|  | @@ -351,18 +352,18 @@ void Game::botMove(String& output) {
 | 
	
		
			
				|  |  |          addLocation(from.x, from.y);
 | 
	
		
			
				|  |  |          directionX = to.x - from.x;
 | 
	
		
			
				|  |  |          directionY = to.y - from.y;
 | 
	
		
			
				|  |  | -        
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          int x = to.x;
 | 
	
		
			
				|  |  |          int y = to.y;
 | 
	
		
			
				|  |  |          rank = -1;
 | 
	
		
			
				|  |  |          for(int mx = -1; mx <= 1; mx++) {
 | 
	
		
			
				|  |  |              for(int my = -1; my <= 1; my++) {
 | 
	
		
			
				|  |  | -                if((mx == 0 && my == 0) || !canMoveActiveStoneTo(mx, my)) {
 | 
	
		
			
				|  |  | +                if((mx == 0 && my == 0) || !canMoveActiveStoneTo(mx, my, WHITE)) {
 | 
	
		
			
				|  |  |                      continue;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  int bx = x + mx;
 | 
	
		
			
				|  |  |                  int by = y + my;
 | 
	
		
			
				|  |  | -                
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                  int rankA = getRank(bx, by, x, y);
 | 
	
		
			
				|  |  |                  int rankB = getRank(x, y, bx, by);
 | 
	
		
			
				|  |  |                  if(rankA > rank) {
 | 
	
	
		
			
				|  | @@ -409,20 +410,27 @@ bool Game::isInQueue(int x, int y) const {
 | 
	
		
			
				|  |  |      return false;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -bool Game::canMoveActiveStoneTo(int dirX, int dirY) const {
 | 
	
		
			
				|  |  | +bool Game::canMoveActiveStoneTo(int dirX, int dirY, FieldState enemy) const {
 | 
	
		
			
				|  |  |      if(directionX == dirX && directionY == dirY) {
 | 
	
		
			
				|  |  |          return false;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      int newX = activeX + dirX;
 | 
	
		
			
				|  |  |      int newY = activeY + dirY;
 | 
	
		
			
				|  |  | +    int hitAX = activeX - dirX;
 | 
	
		
			
				|  |  | +    int hitAY = activeY - dirY;
 | 
	
		
			
				|  |  | +    int hitBX = activeX + 2 * dirX;
 | 
	
		
			
				|  |  | +    int hitBY = activeY + 2 * dirY;
 | 
	
		
			
				|  |  | +    if((!isInRange(hitAX, hitAY) || fields[hitAX][hitAY] != enemy) && (!isInRange(hitBX, hitBY) || fields[hitBX][hitBY] != enemy)) {
 | 
	
		
			
				|  |  | +        return false;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |      return isInRange(newX, newY) && areNeighbours(activeX, activeY, newX, newY) &&
 | 
	
		
			
				|  |  |              fields[newX][newY] == EMPTY && !isInQueue(newX, newY);
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -bool Game::isAnotherTurnPossible() const {
 | 
	
		
			
				|  |  | -    return canMoveActiveStoneTo(-1, -1) || canMoveActiveStoneTo(0, -1) || canMoveActiveStoneTo(1, -1) ||
 | 
	
		
			
				|  |  | -            canMoveActiveStoneTo(-1, 0) || canMoveActiveStoneTo(1, 0) ||
 | 
	
		
			
				|  |  | -            canMoveActiveStoneTo(-1, 1) || canMoveActiveStoneTo(0, 1) || canMoveActiveStoneTo(1, 1);
 | 
	
		
			
				|  |  | +bool Game::isAnotherTurnPossible(FieldState enemy) const {
 | 
	
		
			
				|  |  | +    return canMoveActiveStoneTo(-1, -1, enemy) || canMoveActiveStoneTo(0, -1, enemy) || canMoveActiveStoneTo(1, -1, enemy) ||
 | 
	
		
			
				|  |  | +            canMoveActiveStoneTo(-1, 0, enemy) || canMoveActiveStoneTo(1, 0, enemy) ||
 | 
	
		
			
				|  |  | +            canMoveActiveStoneTo(-1, 1, enemy) || canMoveActiveStoneTo(0, 1, enemy) || canMoveActiveStoneTo(1, 1, enemy);
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  bool Game::markHitSides(int x1, int y1, int x2, int y2, FieldState state) {
 | 
	
	
		
			
				|  | @@ -432,7 +440,7 @@ bool Game::markHitSides(int x1, int y1, int x2, int y2, FieldState state) {
 | 
	
		
			
				|  |  |      hitB.y = y2 + (y2 - y1);
 | 
	
		
			
				|  |  |      return isInRange(hitA.x, hitA.y) && isInRange(hitB.x, hitB.y) &&
 | 
	
		
			
				|  |  |              areNeighbours(x1, y1, hitA.x, hitA.y) && areNeighbours(x2, y2, hitB.x, hitB.y) &&
 | 
	
		
			
				|  |  | -            fields[hitA.x][ hitA.y] == state && fields[hitB.x][ hitB.y] == state;
 | 
	
		
			
				|  |  | +            fields[hitA.x][hitA.y] == state && fields[hitB.x][hitB.y] == state;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  bool Game::shouldEnd() const {
 |