rpsls

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Rock int32 = iota + 1
	Paper
	Scissors
	Lizard
	Spock
)
View Source
const (
	Win  = "win"
	Lose = "lose"
	Tie  = "tie"
)

Variables

View Source
var Choices = model.Choices{
	&model.Choice{
		ID:   Rock,
		Name: "rock",
	},
	&model.Choice{
		ID:   Paper,
		Name: "paper",
	},
	&model.Choice{
		ID:   Scissors,
		Name: "scissors",
	},
	&model.Choice{
		ID:   Lizard,
		Name: "lizard",
	},
	&model.Choice{
		ID:   Spock,
		Name: "spock",
	},
}
View Source
var Victories = map[int32][2]int32{
	Rock:     {Scissors, Lizard},
	Paper:    {Rock, Spock},
	Scissors: {Paper, Lizard},
	Lizard:   {Paper, Spock},
	Spock:    {Scissors, Rock},
}

Functions

This section is empty.

Types

type RockPaperScissorsLizardSpockGame

type RockPaperScissorsLizardSpockGame interface {
	GetChoices() model.Choices
	GetChoice(ctx context.Context) *model.Choice
	PlayRound(ctx context.Context, playerID int32) model.Result
}

func NewRockPaperScissorsLizardSpockGame

func NewRockPaperScissorsLizardSpockGame(rg random.RandomGenerator, logger *zap.Logger) RockPaperScissorsLizardSpockGame

Jump to

Keyboard shortcuts

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