Seafarers: rules tests and engine self-play, AI heads for new islands
This commit is contained in:
@@ -130,6 +130,12 @@ class CatanAi : GameAi<CatanState, CatanMove> {
|
||||
spotValue(state, it.vertex)
|
||||
}?.let { return it }
|
||||
|
||||
// Seafarers: a ship toward an island nobody has landed on is worth more than a card.
|
||||
legal.filterIsInstance<BuildShip>()
|
||||
.filter { shipValue(state, seat, it.edge) > 0.5 }
|
||||
.maxByOrNull { shipValue(state, seat, it.edge) }
|
||||
?.let { return it }
|
||||
|
||||
// A knight is worth playing whenever one is playable: it blocks an
|
||||
// opponent's best hex and marches toward Largest Army.
|
||||
legal.filterIsInstance<PlayKnight>().firstOrNull()?.let { return it }
|
||||
|
||||
Reference in New Issue
Block a user