Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dame-Gruppe-10
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Martin Fritz
Dame-Gruppe-10
Commits
53a25abe
Commit
53a25abe
authored
6 years ago
by
Constantin Geier
Browse files
Options
Downloads
Patches
Plain Diff
ki promotePieces
parent
1d6adeaf
Branches
master
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ki/heuristic.c
+18
-1
18 additions, 1 deletion
ki/heuristic.c
ki/heuristic.h
+1
-1
1 addition, 1 deletion
ki/heuristic.h
ki/simpleKI.c
+1
-0
1 addition, 0 deletions
ki/simpleKI.c
sysprak-client
+0
-0
0 additions, 0 deletions
sysprak-client
with
20 additions
and
2 deletions
ki/heuristic.c
+
18
−
1
View file @
53a25abe
...
...
@@ -40,8 +40,25 @@ int heuristic_simple(const char playingField[8][8],const bool white){
}
void
promotePieces
(
char
playingField
[
8
][
8
],
const
bool
white
){
const
char
youMen
=
white
?
'w'
:
'b'
;
const
char
youQueen
=
white
?
'W'
:
'B'
;
const
int
youFarthestRow
=
white
?
8
:
0
;
for
(
int
i
=
0
;
i
<
8
;
i
++
){
if
(
playingField
[
i
][
youFarthestRow
]
==
youMen
){
playingField
[
i
][
youFarthestRow
]
=
youQueen
;
}
}
}
//uses the loockup table that takes positions into account
int
heuristic_advanced
(
const
char
playingField
[
8
][
8
],
const
bool
white
){
int
heuristic_advanced
(
char
playingField
[
8
][
8
],
const
bool
white
){
//HACK
//we did not promote men to queens yet when this function is called
promotePieces
(
playingField
,
white
);
const
char
youMen
=
white
?
'w'
:
'b'
;
const
char
youQueen
=
white
?
'W'
:
'B'
;
int
score
=
0
;
...
...
This diff is collapsed.
Click to expand it.
ki/heuristic.h
+
1
−
1
View file @
53a25abe
...
...
@@ -7,7 +7,7 @@
int
heuristic_simple
(
const
char
playingField
[
8
][
8
],
const
bool
white
);
int
heuristic_advanced
(
const
char
playingField
[
8
][
8
],
const
bool
white
);
int
heuristic_advanced
(
char
playingField
[
8
][
8
],
const
bool
white
);
...
...
This diff is collapsed.
Click to expand it.
ki/simpleKI.c
+
1
−
0
View file @
53a25abe
...
...
@@ -109,6 +109,7 @@ void random_selectMove(Table* now, char* moveCommandB){
}
}
//select the best jump / best step move possible,
//based on the lookup table
void
weighted_selectMove
(
Table
*
now
,
char
*
moveCommandB
){
...
...
This diff is collapsed.
Click to expand it.
sysprak-client
0 → 100644
+
0
−
0
View file @
53a25abe
File added
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