Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stefano Cobelli
205_hw02
Commits
8ffc004b
Commit
8ffc004b
authored
Nov 14, 2014
by
Stefano Cobelli
Browse files
Blocker player priorities straightened out
parent
f33f2e8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/model/player/BlockerPlayer.java
View file @
8ffc004b
...
@@ -88,9 +88,35 @@ public class BlockerPlayer extends Player implements AutoPlayable {
...
@@ -88,9 +88,35 @@ public class BlockerPlayer extends Player implements AutoPlayable {
}
}
// prioritizing middle
// prioritizing middle
// if (theBoard.isEmpty(theBoard.getSize() / 2, theBoard.getSize() / 2))
if
(
theBoard
.
isEmpty
(
theBoard
.
getSize
()
/
2
,
theBoard
.
getSize
()
/
2
))
{
move
(
theBoard
.
getSize
()
/
2
,
theBoard
.
getSize
()
/
2
);
System
.
out
.
println
(
"Getting random"
);
Integer
[]
answer
=
{
theBoard
.
getSize
()
/
2
,
theBoard
.
getSize
()
/
2
};
return
answer
;
}
// top left corner
if
(
theBoard
.
isEmpty
(
0
,
0
))
{
move
(
0
,
0
);
Integer
[]
answer
=
{
0
,
0
};
return
answer
;
}
// top right corner
if
(
theBoard
.
isEmpty
(
theBoard
.
getSize
()
-
1
,
0
))
{
move
(
theBoard
.
getSize
()
-
1
,
0
);
Integer
[]
answer
=
{
theBoard
.
getSize
()
-
1
,
0
};
return
answer
;
}
// bottom left corner
if
(
theBoard
.
isEmpty
(
0
,
theBoard
.
getSize
()
-
1
))
{
move
(
0
,
theBoard
.
getSize
()
-
1
);
Integer
[]
answer
=
{
0
,
theBoard
.
getSize
()
-
1
};
return
answer
;
}
// bottom right corner
if
(
theBoard
.
isEmpty
(
theBoard
.
getSize
()
-
1
,
theBoard
.
getSize
()
-
1
))
{
move
(
theBoard
.
getSize
()
-
1
,
theBoard
.
getSize
()
-
1
);
Integer
[]
answer
=
{
theBoard
.
getSize
()
-
1
,
theBoard
.
getSize
()
-
1
};
return
answer
;
}
Integer
[][]
coors
=
new
Integer
[
theBoard
.
getSize
()
*
theBoard
.
getSize
()][
2
];
Integer
[][]
coors
=
new
Integer
[
theBoard
.
getSize
()
*
theBoard
.
getSize
()][
2
];
int
index
=
0
;
int
index
=
0
;
...
...
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