Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
W
wordbase-hacker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
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 {
return
;
int
state
=
tiles
[
index
];
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
-
9
);
takeTile
(
tiles
,
x
-
1
,
y
+
1
,
index
+
9
);
...
...
@@ -177,12 +178,14 @@ public class Board {
takeTile
(
tiles
,
x
+
1
,
y
,
index
+
1
);
takeTile
(
tiles
,
x
,
y
+
1
,
index
+
10
);
}
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
-
1
,
y
,
index
-
1
);
takeTile
(
tiles
,
x
+
1
,
y
,
index
+
1
);
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
)
{
...
...
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