prob

package
v0.0.0-...-0992052 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2017 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MoveClaim

func MoveClaim(viewPos *game.ViewPos) (moveix int)

MoveClaim makes a claim flag move.

func MoveDeck

func MoveDeck(viewPos *game.ViewPos) (moveix int)

MoveDeck makes deck move.

func MoveHand

func MoveHand(viewPos *game.ViewPos) (moveix int)

MoveHand makes a move from the hand.

func MoveScoutReturn

func MoveScoutReturn(viewPos *game.ViewPos) (moveix int)

MoveScoutReturn make the scout return move. Strategi return redeploy, return leader if not usable. return exces tactic cards priority traitor,deserter,leader,fog,mud,8,123 return troops minimum not in keep.

Types

type Keep

type Keep struct {
	NewFlagMoveix  int
	PriPlayFlagixs []int
	PriLiveFlagixs []int
	// contains filtered or unexported fields
}

Keep keeps track of higher prioritized flags reserved cards.

func NewKeep

func NewKeep(
	flagsAna map[int]*fa.Analysis,
	moves Moves,
	deckHandTroops *dht.Cache,
	botix int,
) (k *Keep)

NewKeep creates a keep.

func (*Keep) CalcIsHandGood

func (k *Keep) CalcIsHandGood(flagsAna map[int]*fa.Analysis, capNo int) bool

CalcIsHandGood calculate if the hand is good. Calculate the number of good cards on the hand. Numbers of keep(flagHand) + good cards for new flags. More than two new flags must exist. Calculate suited connectors. Remove keep cards and loop over remaining n-2 and compare with cards to the right if connected add card to good set. Phalanx use troopsToStrxTroops Big bigger than 8.

func (*Keep) DemandDump

func (k *Keep) DemandDump(
	flagsAna map[int]*fa.Analysis,
	flagix int) (troop card.Troop)

DemandDump returns the least valued troop.

func (*Keep) DemandScoutReturn

func (k *Keep) DemandScoutReturn(
	no int,
	flagsAna map[int]*fa.Analysis) (troops []card.Troop)

DemandScoutReturn returns maximum of two troop cards that can be returned without problem. Prioritised that least valued card first.

func (*Keep) RequestFlagHandLowestStrenght

func (k *Keep) RequestFlagHandLowestStrenght() (cardMove card.Card)

RequestFlagHandLowestStrenght returns a troop from the hand, that is not reserved if possibel.

func (*Keep) RequestLast

func (k *Keep) RequestLast(reqTroops []card.Troop) (troop card.Card)

RequestLast returns a troop that is not reserved by a flag formation if possible.

func (*Keep) RequestLastHand

func (k *Keep) RequestLastHand(reqTroops []card.Troop) (troop card.Card)

RequestLastHand returns a troop that is not reserved by a flag or a hand(empty flag move ) formation if possible.

func (*Keep) String

func (k *Keep) String() string

type Moves

type Moves []*game.Move

Moves game moves.

func (Moves) FindCone

func (moves Moves) FindCone(coneixs []int) (moveix int)

FindCone finds a cone if not panics.

func (Moves) FindDeck

func (moves Moves) FindDeck(deckPos pos.Card) (moveix int)

FindDeck finds a deck move, if not panics.

func (Moves) FindDeserterMove

func (moves Moves) FindDeserterMove(killCard card.Card) (dMove *game.Move, moveix int)

FindDeserterMove finds a deserter move if not panics.

func (Moves) FindDoubleFlags

func (moves Moves) FindDoubleFlags(guile card.Guile) (dbMoves []*game.Move, moveixs []int)

FindDoubleFlags finds double flag moves redeploy and traitor.

func (Moves) FindHandFlag

func (moves Moves) FindHandFlag(flagix int, cardMove card.Card) (handFlagMove *game.Move, moveix int)

FindHandFlag finds a hand to flag move, if not panics.

func (Moves) FindScoutMove

func (moves Moves) FindScoutMove(deckPos pos.Card) (moveix int)

FindScoutMove finds a scout move, if not panics.

func (Moves) FindScoutReturn

func (moves Moves) FindScoutReturn(tacs []card.Card, troops []card.Troop) (moveix int)

FindScoutReturn finds a scout return moves, if not panics.

func (Moves) SearchPass

func (moves Moves) SearchPass() (moveix int)

SearchPass finds a pass move.

type Sim

type Sim struct {
	Moves
	// contains filtered or unexported fields
}

Sim the general information need to simulate a move.

func (*Sim) Move

func (sim *Sim) Move(move *game.Move) (outFlagAna, inFlagAna *fa.Analysis)

Move simulates a move and analyze the involved flags. a move may effect two flags a in-flag and a out-flag. The flags may be the same incase of a traitor move to the same flag, And one flag may be missing. Hand to flag move only in-flag. Desserter only out-flag. Traitor have both and the may be the same. Redeploy may have two or only a out-flag.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL