Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
PurkkaKoodari
wordbase-hacker
Commits
a0cbf811
Commit
a0cbf811
authored
Sep 09, 2017
by
PurkkaKoodari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stack overflow for adjacent mines
parent
5321181c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
app/src/main/java/net/pietu1998/wordbasehacker/solver/Board.java
.../main/java/net/pietu1998/wordbasehacker/solver/Board.java
+4
-1
No files found.
app/src/main/java/net/pietu1998/wordbasehacker/solver/Board.java
View file @
a0cbf811
...
@@ -168,6 +168,7 @@ public class Board {
...
@@ -168,6 +168,7 @@ public class Board {
return
;
return
;
int
state
=
tiles
[
index
];
int
state
=
tiles
[
index
];
if
(
state
!=
(
state
&=
~
Tile
.
SUPER_MINE
))
{
if
(
state
!=
(
state
&=
~
Tile
.
SUPER_MINE
))
{
tiles
[
index
]
=
(
state
&
~(
Tile
.
OPPONENT
|
Tile
.
SUPER_MINE
))
|
Tile
.
PLAYER
;
takeTile
(
tiles
,
x
-
1
,
y
-
1
,
index
-
11
);
takeTile
(
tiles
,
x
-
1
,
y
-
1
,
index
-
11
);
takeTile
(
tiles
,
x
+
1
,
y
-
1
,
index
-
9
);
takeTile
(
tiles
,
x
+
1
,
y
-
1
,
index
-
9
);
takeTile
(
tiles
,
x
-
1
,
y
+
1
,
index
+
9
);
takeTile
(
tiles
,
x
-
1
,
y
+
1
,
index
+
9
);
...
@@ -177,12 +178,14 @@ public class Board {
...
@@ -177,12 +178,14 @@ public class Board {
takeTile
(
tiles
,
x
+
1
,
y
,
index
+
1
);
takeTile
(
tiles
,
x
+
1
,
y
,
index
+
1
);
takeTile
(
tiles
,
x
,
y
+
1
,
index
+
10
);
takeTile
(
tiles
,
x
,
y
+
1
,
index
+
10
);
}
else
if
(
state
!=
(
state
&=
~
Tile
.
MINE
))
{
}
else
if
(
state
!=
(
state
&=
~
Tile
.
MINE
))
{
tiles
[
index
]
=
(
state
&
~(
Tile
.
OPPONENT
|
Tile
.
MINE
))
|
Tile
.
PLAYER
;
takeTile
(
tiles
,
x
,
y
-
1
,
index
-
10
);
takeTile
(
tiles
,
x
,
y
-
1
,
index
-
10
);
takeTile
(
tiles
,
x
-
1
,
y
,
index
-
1
);
takeTile
(
tiles
,
x
-
1
,
y
,
index
-
1
);
takeTile
(
tiles
,
x
+
1
,
y
,
index
+
1
);
takeTile
(
tiles
,
x
+
1
,
y
,
index
+
1
);
takeTile
(
tiles
,
x
,
y
+
1
,
index
+
10
);
takeTile
(
tiles
,
x
,
y
+
1
,
index
+
10
);
}
else
{
tiles
[
index
]
=
(
state
&
~
Tile
.
OPPONENT
)
|
Tile
.
PLAYER
;
}
}
tiles
[
index
]
=
(
state
&
~
Tile
.
OPPONENT
)
|
Tile
.
PLAYER
;
}
}
private
void
addConnected
(
int
[]
tiles
,
int
x
,
int
y
,
int
index
,
boolean
[]
positions
)
{
private
void
addConnected
(
int
[]
tiles
,
int
x
,
int
y
,
int
index
,
boolean
[]
positions
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment