goxai

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: GPL-3.0 Imports: 2 Imported by: 1

Documentation

Overview

Package goxai provides a small API using the minimax algorithm with alpha-beta pruning.

Index

Constants

View Source
const (
	Win = Score(10)

	Tie  = Score(0)
	Loss = Score(-10)
)

Constants denoting common score values.

Variables

This section is empty.

Functions

func Set

func Set(g *gox.AIGame, difficulty int) error

Set sets the first field with the greatest score to AIGame.ArtInt.

Types

type Score

type Score int

Score is a pseudo value rating a cell of a game. Higher values means more likelyhood to win.

func EvalFields

func EvalFields(g *gox.AIGame, difficulty int) (row, column int, scr Score,
	err error)

EvalFields returns the first cell with the greatest score and the score. It executes paralel.

func Evaluate

func Evaluate(g *gox.AIGame, row, column, difficulty int) (Score, error)

Evaluate returns a score from -10 to 10 for the given cell.

Jump to

Keyboard shortcuts

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