Skip to content

Commit

Permalink
filter survivor instead of list of alive players
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsandow committed Nov 22, 2017
1 parent 60675fa commit b0431e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Referee.java
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ protected boolean isGameOver() {
Player survivor = alive.get(0);

// If only one player is alive and he got the highest score, end the game now.
return players.stream().filter(p -> p != alive).allMatch(p -> p.score < survivor.score);
return players.stream().filter(p -> p != survivor).allMatch(p -> p.score < survivor.score);
}

// Everyone is dead. End of the game.
Expand Down

0 comments on commit b0431e0

Please sign in to comment.