diff --git a/AI/src/game/penguin.cpp b/AI/src/game/penguin.cpp
index cffd46023f9b785088107c10beb862beca10eb94..29c6f7478ab4d69608a0b480c93187c903c24523 100644
--- a/AI/src/game/penguin.cpp
+++ b/AI/src/game/penguin.cpp
@@ -46,7 +46,7 @@ namespace game
 			if(json_state["score"].count("red")) { state.score_red = json_state["score"]["red"]; }
 			if(json_state["score"].count("blue")) { state.score_blue = json_state["score"]["blue"]; }
 		}
-		
+
 		//Update moves on all penguins
 		uint64_t obstacles = (~(state.one_fish | state.two_fish | state.three_fish));
 		obstacles |= ((uint64_t) 1) << (state.p1_red & 63);
@@ -68,7 +68,7 @@ namespace game
 		state.nb_moves_blue += update_moves(&state.p2_blue, obstacles);
 		state.nb_moves_blue += update_moves(&state.p3_blue, obstacles);
 		state.nb_moves_blue += update_moves(&state.p4_blue, obstacles);
-		
+
 		if (state.nb_moves_red == 0)
 		{
 			state.canPlay_red = false;
@@ -294,7 +294,7 @@ namespace game
 		//Direction C
 		nbmoves = 0;
 		i = pos;
-		while((i-8 > 0) && (i%15 != 0) && IsFree(i-8))
+		while((i-8 >= 0) && (i%15 != 0) && IsFree(i-8))
 		{
 			i -= 8;
 			nbmoves++; total_moves++;
@@ -388,7 +388,7 @@ namespace game
 
 		state.nb_moves_red = 0;
 		state.nb_moves_blue = 0;
-		
+
 		if (state.current_player_red) //Red just played
 		{
 			if(state.canPlay_blue)
@@ -407,7 +407,7 @@ namespace game
 			{
 				state.nb_moves_blue = 1;
 			}
-			
+
 			state.current_player_red = false;
 		}
 		else //Blue just played
@@ -428,7 +428,7 @@ namespace game
 			{
 				state.nb_moves_red = 1;
 			}
-			
+
 			state.current_player_red = true;
 		}
 	}
@@ -476,7 +476,7 @@ namespace game
 		json_state["possible_moves"]["blue"] = state.nb_moves_blue;
 
 		json_state["current_player"] = state.current_player_red ? "Red" : "Blue";
-		
+
 		json_state["can_play"]["red"] = state.canPlay_red;
 		json_state["can_play"]["blue"] = state.canPlay_blue;