Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
Main
Synchronet
Commits
8a5df29d
Commit
8a5df29d
authored
16 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Add new UltraParanoid mode for Deep Blue.
Deep Blue should not suck at the start. :-)
parent
4b3b363b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
xtrn/dicewarz/ai.ini
+1
-1
1 addition, 1 deletion
xtrn/dicewarz/ai.ini
xtrn/dicewarz/ai.js
+39
-1
39 additions, 1 deletion
xtrn/dicewarz/ai.js
with
40 additions
and
2 deletions
xtrn/dicewarz/ai.ini
+
1
−
1
View file @
8a5df29d
...
...
@@ -10,7 +10,7 @@ Quantity=Full
[Deep Blue]
Sort
=
GroupParanoid
Check
=
Paranoid
Check
=
Ultra
Paranoid
Quantity
=
Single
[AutoDeuce]
...
...
This diff is collapsed.
Click to expand it.
xtrn/dicewarz/ai.js
+
39
−
1
View file @
8a5df29d
...
...
@@ -138,6 +138,44 @@ function WildAndCrazyAICheck(gameNumber, playerNumber, base, target)
}
return
(
false
);
}
function
UltraParanoidAICheck
(
gameNumber
,
playerNumber
,
base
,
target
)
{
g
=
games
.
gameData
[
gameNumber
];
computerPlayer
=
g
.
players
[
playerNumber
];
if
(
computerPlayer
.
reserve
>
7
)
return
(
ParanoidAICheck
(
gameNumber
,
playerNumber
,
base
,
target
));
/* First, check if we would leave ourselves open. If so,
* do not take the risk */
var
dirs
=
g
.
LoadDirectional
(
base
);
for
(
dir
in
dirs
)
{
current
=
dirs
[
dir
];
if
(
current
==
target
)
continue
;
if
(
g
.
grid
[
current
])
{
if
(
g
.
grid
[
current
].
player
!=
player
&&
g
.
grid
[
current
].
dice
>
1
)
return
(
false
);
}
}
/* Next, check that we have a dice advantage */
if
(
g
.
grid
[
base
].
dice
<=
g
.
grid
[
target
].
dice
)
return
(
false
);
/* Finally, check that we will still be at least equal after the capture */
dirs
=
g
.
LoadDirectional
(
target
);
for
(
dir
in
dirs
)
{
current
=
dirs
[
dir
];
if
(
current
==
target
)
continue
;
if
(
g
.
grid
[
current
])
{
if
(
g
.
grid
[
current
].
player
!=
player
&&
g
.
grid
[
current
].
dice
>=
g
.
grid
[
base
].
dice
)
return
(
false
);
}
}
return
(
true
);
}
/* Callbacks for selecting the number of targets to use */
function
RandomAttackQuantity
(
tlen
)
...
...
@@ -158,5 +196,5 @@ function SingleAttackQuantity(tlen)
}
var
AISortFunctions
=
{
Random
:
RandomSort
,
Wild
:
WildAndCrazyAISort
,
KillMost
:
KillMostDiceAISort
,
Paranoia
:
ParanoiaAISort
,
RandomAI
:
RandomAISort
,
GroupParanoid
:
GroupAndParanoidAISort
};
var
AICheckFunctions
=
{
Random
:
RandomAICheck
,
Paranoid
:
ParanoidAICheck
,
Wild
:
WildAndCrazyAICheck
};
var
AICheckFunctions
=
{
Random
:
RandomAICheck
,
Paranoid
:
ParanoidAICheck
,
Wild
:
WildAndCrazyAICheck
,
UltraParanoid
:
UltraParanoidAICheck
};
var
AIQtyFunctions
=
{
Random
:
RandomAttackQuantity
,
Full
:
FullAttackQuantity
,
Single
:
SingleAttackQuantity
};
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