endgame

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: GPL-3.0 Imports: 6 Imported by: 1

Documentation

Overview

Package endgame solves the endgame. It uses some sort of efficient tree search.

Package endgame implements a crossword game endgame solver. The endgame solver uses the B* algorithm. See "The B* Tree Search Algorithm: A Best-First Proof Procedure" by Hans Berliner

Index

Constants

View Source
const CostConstant = 5000
View Source
const Infinity = 1e6

I guess Infinity isn't that big.

Variables

This section is empty.

Functions

This section is empty.

Types

type AStarSolver

type AStarSolver struct {
	// contains filtered or unexported fields
}

AStarSolver implements the A* algorithm. I don't know how to implement B* so let's see how this does first, and improve on it later. Maybe I'll learn something.

func (*AStarSolver) Init

func (a *AStarSolver) Init(board *board.GameBoard, movegen *movegen.GordonGenerator,
	bag *alphabet.Bag, gd *gaddag.SimpleGaddag)

type BStarSolver

type BStarSolver struct {
	// contains filtered or unexported fields
}

BStarSolver implements the B* algorithm.

func (*BStarSolver) Init

func (b *BStarSolver) Init(board *board.GameBoard, movegen *movegen.GordonGenerator,
	bag *alphabet.Bag, gd *gaddag.SimpleGaddag)

func (*BStarSolver) Solve

func (b *BStarSolver) Solve(playerOnTurn, opponent *alphabet.Rack) *move.Move

type Solver

type Solver interface {
	Init(board *board.GameBoard, movegen *movegen.GordonGenerator,
		bag *alphabet.Bag, gd *gaddag.SimpleGaddag)
	Solve(playerOnTurn, opponent *alphabet.Rack) *move.Move
}

Solver is an interface for an endgame solver. The scores don't matter, this solver maximizes spread.

type TreeNode

type TreeNode struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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