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
2206bbd9
Commit
2206bbd9
authored
9 years ago
by
Bariatti Francesco
Browse files
Options
Downloads
Patches
Plain Diff
Corrected some compilation errors
parent
cf6a9635
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/game/morpion.cpp
+11
-9
11 additions, 9 deletions
src/game/morpion.cpp
src/game/morpion.hpp
+1
-1
1 addition, 1 deletion
src/game/morpion.hpp
with
12 additions
and
10 deletions
src/game/morpion.cpp
+
11
−
9
View file @
2206bbd9
...
...
@@ -73,10 +73,10 @@ namespace game
int
morpion
::
value
(
uint8_t
player
)
const
{
if
(
player
==
CROSS
)
{
return
state
.
first_player_win
?
1
:
(
state
.
second_player_win
?
-
1
:
0
)
return
state
.
first_player_win
?
1
:
(
state
.
second_player_win
?
-
1
:
0
)
;
}
else
if
(
player
==
CIRCLE
)
{
return
state
.
second_player_win
?
1
:
(
state
.
first_player_win
?
-
1
:
0
)
return
state
.
second_player_win
?
1
:
(
state
.
first_player_win
?
-
1
:
0
)
;
}
return
0
;
}
...
...
@@ -86,7 +86,7 @@ namespace game
return
state
.
total_moves
;
}
bool
morpion
::
get
(
uint6
4
_t
bitboard
,
uint8_t
col
,
uint8_t
row
)
const
bool
morpion
::
get
(
uint
1
6_t
bitboard
,
uint8_t
col
,
uint8_t
row
)
const
{
return
bitboard
&
(
1LL
<<
(
3
*
row
))
<<
col
;
}
...
...
@@ -112,16 +112,17 @@ namespace game
return
false
;
}
/*
void morpion::update_moves(uint16_t move)
{
//TODO: Implement
}
*/
void
morpion
::
play
(
uint16_t
m
)
// not finished
void
morpion
::
play
(
uint16_t
m
)
{
uint16_t
bitboard
=
cross_bitboard
|
circle_bitboard
;
if
(
current_player
()
==
CROSS
)
uint16_t
bitboard
=
state
.
cross_bitboard
|
state
.
circle_bitboard
;
return
;
}
...
...
@@ -140,7 +141,7 @@ namespace game
{
uint8_t
row
=
m
/
3
;
uint8_t
col
=
m
%
3
;
return
"( "
std
::
to_string
(
row
)
", "
std
::
to_string
(
col
)
" )"
;
return
"( "
+
std
::
to_string
(
row
)
+
", "
+
std
::
to_string
(
col
)
+
" )"
;
}
...
...
@@ -155,8 +156,9 @@ namespace game
string
morpion
::
to_string
()
const
{
for
(
int
i
=
0
//
for (int i = 0
//TODO PAR ROMAIN
return
""
;
}
void
morpion
::
playout
(
mt19937
&
engine
,
int
max_depth
)
...
...
This diff is collapsed.
Click to expand it.
src/game/morpion.hpp
+
1
−
1
View file @
2206bbd9
...
...
@@ -49,7 +49,7 @@ namespace game
inline
void
update_win
();
//Check if someone won and update the state
inline
bool
has_won
(
uint16_t
bitboard
);
//Check if the player whose bitboard was passed as a param has won
inline
bool
get
(
uint16_t
bitboard
,
uint8_t
i
,
uint8_t
j
)
const
;
//Get a case of the board
const
uint8_t
CROSS
=
0
;
const
uint8_t
CIRCLE
=
1
;
...
...
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