gomoku

package
v0.0.0-...-7f180d0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2020 acrazing <joking.young@gmail.com>. All rights reserved. Since 2020-01-08 23:34:40

Index

Constants

View Source
const (
	PieceNone  = 0
	PieceBlack = 1
	PieceWhite = 2
)
View Source
const (
	CodeOk = iota
	CodeInvalidLocation
	CodeForbiddenLocation
	CodeUnavailableLocation
	CodeInvalidPiece
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code int

type Hand

type Hand struct {
	Row uint32
	Col uint32
	// the time offset from createdAt, 0.1s as 1
	Ts uint32
}

type History

type History []*Hand

func (History) String

func (h History) String() string

type Machine

type Machine struct {
	Rows           uint32
	Cols           uint32
	History        History
	Board          [][]uint32
	CreatedAt      int64
	Winner         uint32
	WinnerLocation *Hand
}

func NewMachine

func NewMachine(rows uint32, cols uint32, history History) *Machine

func (*Machine) Compute

func (m *Machine) Compute()

func (*Machine) IsForbidden

func (m *Machine) IsForbidden(row, col uint32) bool

func (*Machine) Play

func (m *Machine) Play(piece, row, col uint32) Code

Directories

Path Synopsis
base 64 number format
base 64 number format

Jump to

Keyboard shortcuts

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