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
5fe26243
Commit
5fe26243
authored
7 years ago
by
Salard Xavier
Browse files
Options
Downloads
Patches
Plain Diff
Implementation of the penguin_move_board fonction
parent
0325ef1c
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.conf
+1
-1
1 addition, 1 deletion
AI.conf
AI/src/game/penguin.cpp
+30
-0
30 additions, 0 deletions
AI/src/game/penguin.cpp
with
31 additions
and
1 deletion
AI.conf
+
1
−
1
View file @
5fe26243
ai_vs_ai
=
1
ai_think_time
=
5000
ai_vs_ai_game_count
=
100
heuristic_ai_1
=
default
heuristic_ai_1
=
points
heuristic_ai_2
=
default
send_game_to_gui
=
1
This diff is collapsed.
Click to expand it.
AI/src/game/penguin.cpp
+
30
−
0
View file @
5fe26243
...
...
@@ -526,6 +526,36 @@ namespace game
return
board
;
}
uint64_t
pengin
::
penguin_move_board
(
const
uint32_t
&
pen
)
const
{
uint64_t
board
=
0
;
//Direction A
for
(
int
i
=
1
;
i
<=
PENGUIN_MOVES_A
(
pen
);
i
++
){
board
|=
((
uint64_t
)
1
<<
PENGUIN_POS
(
pen
)
+
i
*
7
);
}
//Direction B
for
(
int
i
=
1
;
i
<=
PENGUIN_MOVES_B
(
pen
);
i
++
){
board
|=
((
uint64_t
)
1
<<
PENGUIN_POS
(
pen
)
+
i
*
(
-
1
));
}
//Direction C
for
(
int
i
=
1
;
i
<=
PENGUIN_MOVES_C
(
pen
);
i
++
){
board
|=
((
uint64_t
)
1
<<
PENGUIN_POS
(
pen
)
+
i
*
(
-
8
));
}
//Direction D
for
(
int
i
=
1
;
i
<=
PENGUIN_MOVES_D
(
pen
);
i
++
){
board
|=
((
uint64_t
)
1
<<
PENGUIN_POS
(
pen
)
+
i
*
(
-
7
));
}
//Direction E
for
(
int
i
=
1
;
i
<=
PENGUIN_MOVES_E
(
pen
);
i
++
){
board
|=
((
uint64_t
)
1
<<
PENGUIN_POS
(
pen
)
+
i
*
1
);
}
//Direction F
for
(
int
i
=
1
;
i
<=
PENGUIN_MOVES_A
(
pen
);
i
++
){
board
|=
((
uint64_t
)
1
<<
PENGUIN_POS
(
pen
)
+
i
*
8
);
}
return
board
;
}
uint8_t
penguin
::
turns_played
()
const
{
uint8_t
played
=
0
;
...
...
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