Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pingouins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felton Samuel
pingouins
Commits
239e7ec5
Commit
239e7ec5
authored
8 years ago
by
Salard Xavier
Browse files
Options
Downloads
Patches
Plain Diff
Creation of the penguin_board function, still a few things to debug in it
parent
9ceaa2ef
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AI/src/game/penguin.cpp
+21
-0
21 additions, 0 deletions
AI/src/game/penguin.cpp
AI/src/game/penguin.hpp
+1
-0
1 addition, 0 deletions
AI/src/game/penguin.hpp
with
22 additions
and
0 deletions
AI/src/game/penguin.cpp
+
21
−
0
View file @
239e7ec5
...
...
@@ -63,6 +63,10 @@ namespace game
state
.
canPlay_blue
=
false
;
state
.
nb_moves_blue
=
1
;
//We create an artificial move so that the mcts works
}
std
::
cout
<<
penguin_board
(
BLUE
)
<<
std
::
endl
;
std
::
cout
<<
penguin_board
(
RED
)
<<
std
::
endl
;
}
penguin
::
penguin
(
bool
b
)
{
...
...
@@ -509,4 +513,21 @@ namespace game
return
s
;
}
uint64_t
penguin
::
penguin_board
(
bool
color
){
//A penguin alone on the case 0 correspond to a bitboard which value is 1
uint64_t
board
=
0ULL
;
if
(
!
color
){
for
(
int
i
=
0
;
i
<
4
;
i
++
){
board
|=
(((
uint64_t
)
1
)
<<
(
(
uint64_t
)(
state
.
peng_red
[
i
])
&
63
));
std
::
cout
<<
PENGUIN_POS
(
state
.
peng_red
[
i
])
<<
" : "
<<
board
<<
std
::
endl
;
}
}
else
{
for
(
int
i
=
0
;
i
<
4
;
i
++
){
board
|=
(
((
uint64_t
)
1
)
<<
(
(
uint64_t
)(
state
.
peng_blue
[
i
])
&
63
));
std
::
cout
<<
PENGUIN_POS
(
state
.
peng_blue
[
i
])
<<
" : "
<<
board
<<
std
::
endl
;
}
}
return
board
;
}
}
This diff is collapsed.
Click to expand it.
AI/src/game/penguin.hpp
+
1
−
0
View file @
239e7ec5
...
...
@@ -79,6 +79,7 @@ namespace game
*/
const
tile_content
get_tile
(
std
::
uint8_t
tile_index
)
const
;
static
penguin_state
random_start_state
();
std
::
uint64_t
penguin_board
(
bool
);
// true for position of blue penguin, else false
private
:
penguin_state
state
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment