memory

package
v0.0.0-...-6b15219 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package memory is a simple example game based on memory--where players take turn flipping over two cards, and keeping them if they match.

Index

Constants

View Source
const DefaultMemoryFuzziness = 0.03

DefaultMemoryFuzziness is how likely the agent is to forget each thing it remembers.

View Source
const DefaultMemoryLength = 6

DefaultMemoryLength is how much the default agent should be able to remember.

Variables

This section is empty.

Functions

func NewDelegate

func NewDelegate() boardgame.GameDelegate

NewDelegate is the primary entrypoint to this package. It returns a GameDelegate that configures a memory game.

Types

type Agent

type Agent struct{}

Agent represents an agent capable of playing memory.

func (*Agent) DisplayName

func (a *Agent) DisplayName() string

DisplayName returns "Robby the Robot"

func (*Agent) Name

func (a *Agent) Name() string

Name returns "ai"

func (*Agent) ProposeMove

func (a *Agent) ProposeMove(game *boardgame.Game, player boardgame.PlayerIndex, aState []byte) (move boardgame.Move, newState []byte)

ProposeMove is the primary logic of the memory Agent.

func (*Agent) SetUpForGame

func (a *Agent) SetUpForGame(game *boardgame.Game, player boardgame.PlayerIndex) []byte

SetUpForGame configures a default agent.

Jump to

Keyboard shortcuts

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