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
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
Bariatti Francesco
pingouins
Commits
def0b7f0
Commit
def0b7f0
authored
9 years ago
by
Romain Lebouc
Browse files
Options
Downloads
Patches
Plain Diff
Implemented function to_string
String representation of the whole board
parent
2206bbd9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/game/morpion.cpp
+16
-3
16 additions, 3 deletions
src/game/morpion.cpp
with
16 additions
and
3 deletions
src/game/morpion.cpp
+
16
−
3
View file @
def0b7f0
...
...
@@ -156,9 +156,22 @@ namespace game
string
morpion
::
to_string
()
const
{
//for (int i = 0
//TODO PAR ROMAIN
return
""
;
string
result
=
""
;
for
(
int
row
=
2
;
row
>=
0
;
row
--
)
{
result
+=
"|"
for
(
int
col
=
2
;
col
>=
0
;
col
--
)
{
if
(((
state
.
cross_bitboard
>>
3
*
row
)
>>
col
)
&
1
)
result
+=
player_to_string
(
CROSS
)
+
"|"
;
else
if
(((
state
.
circle_bitboard
>>
3
*
row
)
>>
col
)
&
1
)
result
+=
player_to_string
(
CIRCLE
)
+
"|"
;
else
result
+=
" |"
;
}
result
+=
"
\n
-------
\n
"
;
}
return
result
;
}
void
morpion
::
playout
(
mt19937
&
engine
,
int
max_depth
)
...
...
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