mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
Merge pull request #513 from guusdk/SPARK-2151_Reversi-indexoutofbounds
SPARK-2151: Prevent IndexOutOfBoundsException in Reversi
This commit is contained in:
@ -10,7 +10,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>reversi</artifactId>
|
<artifactId>reversi</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.6</version>
|
||||||
|
|
||||||
<name>Reversi</name>
|
<name>Reversi</name>
|
||||||
<description>Multiplayer game of Reversi.</description>
|
<description>Multiplayer game of Reversi.</description>
|
||||||
|
|||||||
@ -329,7 +329,7 @@ public class ReversiModel {
|
|||||||
}
|
}
|
||||||
// Going down vertically.
|
// Going down vertically.
|
||||||
if (position < 48) {
|
if (position < 48) {
|
||||||
for (int i=position+8; i <= 65; i+=8) {
|
for (int i=position+8; i <= 64; i+=8) {
|
||||||
if (board[i] == BLANK) {
|
if (board[i] == BLANK) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -438,4 +438,4 @@ public class ReversiModel {
|
|||||||
|
|
||||||
return flipCount;
|
return flipCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user