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
e8ebd880
Commit
e8ebd880
authored
9 years ago
by
Bariatti Francesco
Browse files
Options
Downloads
Patches
Plain Diff
hashtag it compiles
parent
582e055f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/game/morpion.cpp
+3
-3
3 additions, 3 deletions
src/game/morpion.cpp
src/game/morpion.hpp
+1
-1
1 addition, 1 deletion
src/game/morpion.hpp
with
4 additions
and
4 deletions
src/game/morpion.cpp
+
3
−
3
View file @
e8ebd880
...
...
@@ -113,7 +113,7 @@ namespace game
}
void
morpion
::
update_moves
(
uint16_t
move
)
void
morpion
::
update_moves
()
{
uint16_t
free_bitboard
=
~
(
state
.
cross_bitboard
|
state
.
circle_bitboard
);
for
(
int
i
=
0
;
i
<=
8
;
i
++
)
...
...
@@ -121,7 +121,7 @@ namespace game
if
(
free_bitboard
&
1
)
{
state
.
possible_moves
+=
i
;
state
.
possible_moves
<<
4
;
state
.
possible_moves
=
state
.
possible_moves
<<
4
;
}
free_bitboard
=
free_bitboard
>>
1
;
}
...
...
@@ -176,7 +176,7 @@ namespace game
string
result
=
""
;
for
(
int
row
=
2
;
row
>=
0
;
row
--
)
{
result
+=
"|"
result
+=
"|"
;
for
(
int
col
=
2
;
col
>=
0
;
col
--
)
{
if
(((
state
.
cross_bitboard
>>
3
*
row
)
>>
col
)
&
1
)
...
...
This diff is collapsed.
Click to expand it.
src/game/morpion.hpp
+
1
−
1
View file @
e8ebd880
...
...
@@ -50,7 +50,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
inline
void
update_moves
(
uint16_t
move
);
//Update the list of all possible moves
inline
void
update_moves
();
//Update the list of all possible moves
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