connect4

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

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "connect4"

	BoardWidth  = 7
	BoardHeight = 6
)
View Source
const PlacePacketName = "connect-4-player-place"
View Source
const PlayerPlacedPacketName = "connect-4-player-placed"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell byte
const (
	EmptyCell Cell = iota
	RedCell
	YellowCell
)

func (Cell) ToColor

func (c Cell) ToColor() Color

type Color

type Color bool
const (
	RedColor    Color = true
	YellowColor Color = false
)

func (Color) ToCell

func (c Color) ToCell() Cell

type PlacePacket

type PlacePacket struct {
	PacketName string
	X          int32
}

type PlayerPlacedPacket

type PlayerPlacedPacket struct {
	PacketName string
	Player     Color
	X          int32
}

Jump to

Keyboard shortcuts

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