updates
This commit is contained in:
parent
e590baf28d
commit
6382de19c9
15 changed files with 239 additions and 28 deletions
|
|
@ -16,10 +16,14 @@ test('random bots play 200 games with every card without breaking a rule', () =>
|
|||
});
|
||||
|
||||
test('greedy bots play 200 games without breaking a rule', () => {
|
||||
let wins = 0;
|
||||
for (let seed = 1; seed <= 200; seed++) {
|
||||
const s = playGame({ pool, bots: [() => greedyBot(), () => greedyBot()], seed, check: true });
|
||||
assert.equal(s.endReason, 'win');
|
||||
assert.ok(s.over);
|
||||
if (s.endReason === 'win') wins++;
|
||||
}
|
||||
// A rare game stalls: every location defended and no attack at good odds.
|
||||
assert.ok(wins >= 196, `only ${wins}/200 games ended in a win`);
|
||||
});
|
||||
|
||||
test('greedy beats random', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue