Documentation ¶
Overview ¶
Package rps defines interfaces for playing the game Rock-Paper-Scissors. It is an example of a simple Vanadium service.
http://en.wikipedia.org/wiki/Rock-paper-scissors
There are three different roles in the game:
1. Judge: A judge enforces the rules of the game and decides who the winner is. At the end of the game, the judge reports the final score to all the score keepers.
2. Player: A player can ask a judge to start a new game, it can challenge another player, and it can play a game.
3. ScoreKeeper: A score keeper receives the final score for a game after it ended.
Index ¶
- Constants
- Variables
- func VDLReadJudgeAction(dec vdl.Decoder, x *JudgeAction) error
- func VDLReadPlayerAction(dec vdl.Decoder, x *PlayerAction) error
- type GameId
- type GameOptions
- type GameTypeTag
- type JudgeAction
- type JudgeActionMoveOptions
- func (x JudgeActionMoveOptions) Index() int
- func (x JudgeActionMoveOptions) Interface() interface{}
- func (x JudgeActionMoveOptions) Name() string
- func (x JudgeActionMoveOptions) VDLIsZero() bool
- func (x JudgeActionMoveOptions) VDLReflect(vdlJudgeActionReflect)
- func (x JudgeActionMoveOptions) VDLWrite(enc vdl.Encoder) error
- type JudgeActionOpponentName
- func (x JudgeActionOpponentName) Index() int
- func (x JudgeActionOpponentName) Interface() interface{}
- func (x JudgeActionOpponentName) Name() string
- func (x JudgeActionOpponentName) VDLIsZero() bool
- func (x JudgeActionOpponentName) VDLReflect(vdlJudgeActionReflect)
- func (x JudgeActionOpponentName) VDLWrite(enc vdl.Encoder) error
- type JudgeActionPlayerNum
- func (x JudgeActionPlayerNum) Index() int
- func (x JudgeActionPlayerNum) Interface() interface{}
- func (x JudgeActionPlayerNum) Name() string
- func (x JudgeActionPlayerNum) VDLIsZero() bool
- func (x JudgeActionPlayerNum) VDLReflect(vdlJudgeActionReflect)
- func (x JudgeActionPlayerNum) VDLWrite(enc vdl.Encoder) error
- type JudgeActionRoundResult
- func (x JudgeActionRoundResult) Index() int
- func (x JudgeActionRoundResult) Interface() interface{}
- func (x JudgeActionRoundResult) Name() string
- func (x JudgeActionRoundResult) VDLIsZero() bool
- func (x JudgeActionRoundResult) VDLReflect(vdlJudgeActionReflect)
- func (x JudgeActionRoundResult) VDLWrite(enc vdl.Encoder) error
- type JudgeActionScore
- type JudgeClientMethods
- type JudgeClientStub
- type JudgePlayClientCall
- type JudgePlayClientStream
- type JudgePlayServerCall
- type JudgePlayServerCallStub
- type JudgePlayServerStream
- type JudgeServerMethods
- type JudgeServerStub
- type JudgeServerStubMethods
- type PlayResult
- type PlayerAction
- type PlayerActionMove
- type PlayerActionQuit
- type PlayerClientMethods
- type PlayerClientStub
- type PlayerServerMethods
- type PlayerServerStub
- type PlayerServerStubMethods
- type PlayersMoves
- type RockPaperScissorsClientMethods
- type RockPaperScissorsClientStub
- type RockPaperScissorsServerMethods
- type RockPaperScissorsServerStub
- type RockPaperScissorsServerStubMethods
- type Round
- type ScoreCard
- type ScoreKeeperClientMethods
- type ScoreKeeperClientStub
- type ScoreKeeperServerMethods
- type ScoreKeeperServerStub
- type ScoreKeeperServerStubMethods
- type Unused
- type WinnerTag
Constants ¶
const Classic = GameTypeTag(0) // Rock-Paper-Scissors
const Draw = WinnerTag(0)
const LizardSpock = GameTypeTag(1) // Rock-Paper-Scissors-Lizard-Spock
const Player1 = WinnerTag(1)
const Player2 = WinnerTag(2)
Variables ¶
var JudgeDesc rpc.InterfaceDesc = descJudge
JudgeDesc describes the Judge interface.
var PlayerDesc rpc.InterfaceDesc = descPlayer
PlayerDesc describes the Player interface.
var RockPaperScissorsDesc rpc.InterfaceDesc = descRockPaperScissors
RockPaperScissorsDesc describes the RockPaperScissors interface.
var ScoreKeeperDesc rpc.InterfaceDesc = descScoreKeeper
ScoreKeeperDesc describes the ScoreKeeper interface.
Functions ¶
func VDLReadJudgeAction ¶
func VDLReadJudgeAction(dec vdl.Decoder, x *JudgeAction) error
func VDLReadPlayerAction ¶
func VDLReadPlayerAction(dec vdl.Decoder, x *PlayerAction) error
Types ¶
type GameId ¶
type GameId struct {
Id string
}
A GameId is used to uniquely identify a game within one Judge.
func (GameId) VDLReflect ¶
type GameOptions ¶
type GameOptions struct { NumRounds int32 // The number of rounds that a player must win to win the game. GameType GameTypeTag // The type of game to play: Classic or LizardSpock. }
GameOptions specifies the parameters of a game.
func (GameOptions) VDLIsZero ¶
func (x GameOptions) VDLIsZero() bool
func (GameOptions) VDLReflect ¶
func (GameOptions) VDLReflect(struct { Name string `vdl:"v.io/x/ref/examples/rps.GameOptions"` })
type GameTypeTag ¶
type GameTypeTag byte
func (GameTypeTag) VDLIsZero ¶
func (x GameTypeTag) VDLIsZero() bool
func (GameTypeTag) VDLReflect ¶
func (GameTypeTag) VDLReflect(struct { Name string `vdl:"v.io/x/ref/examples/rps.GameTypeTag"` })
type JudgeAction ¶
type JudgeAction interface { // Index returns the field index. Index() int // Interface returns the field value as an interface. Interface() interface{} // Name returns the field name. Name() string // VDLReflect describes the JudgeAction union type. VDLReflect(vdlJudgeActionReflect) VDLIsZero() bool VDLWrite(vdl.Encoder) error }
JudgeAction represents any single field of the JudgeAction union type.
type JudgeActionMoveOptions ¶
type JudgeActionMoveOptions struct{ Value []string } // A list of allowed moves that the player must choose from.
JudgeActionMoveOptions represents field MoveOptions of the JudgeAction union type.
func (JudgeActionMoveOptions) Index ¶
func (x JudgeActionMoveOptions) Index() int
func (JudgeActionMoveOptions) Interface ¶
func (x JudgeActionMoveOptions) Interface() interface{}
func (JudgeActionMoveOptions) Name ¶
func (x JudgeActionMoveOptions) Name() string
func (JudgeActionMoveOptions) VDLIsZero ¶
func (x JudgeActionMoveOptions) VDLIsZero() bool
func (JudgeActionMoveOptions) VDLReflect ¶
func (x JudgeActionMoveOptions) VDLReflect(vdlJudgeActionReflect)
type JudgeActionOpponentName ¶
type JudgeActionOpponentName struct{ Value string } // The name of the opponent.
JudgeActionOpponentName represents field OpponentName of the JudgeAction union type.
func (JudgeActionOpponentName) Index ¶
func (x JudgeActionOpponentName) Index() int
func (JudgeActionOpponentName) Interface ¶
func (x JudgeActionOpponentName) Interface() interface{}
func (JudgeActionOpponentName) Name ¶
func (x JudgeActionOpponentName) Name() string
func (JudgeActionOpponentName) VDLIsZero ¶
func (x JudgeActionOpponentName) VDLIsZero() bool
func (JudgeActionOpponentName) VDLReflect ¶
func (x JudgeActionOpponentName) VDLReflect(vdlJudgeActionReflect)
type JudgeActionPlayerNum ¶
type JudgeActionPlayerNum struct{ Value int32 } // The player's number.
JudgeActionPlayerNum represents field PlayerNum of the JudgeAction union type.
func (JudgeActionPlayerNum) Index ¶
func (x JudgeActionPlayerNum) Index() int
func (JudgeActionPlayerNum) Interface ¶
func (x JudgeActionPlayerNum) Interface() interface{}
func (JudgeActionPlayerNum) Name ¶
func (x JudgeActionPlayerNum) Name() string
func (JudgeActionPlayerNum) VDLIsZero ¶
func (x JudgeActionPlayerNum) VDLIsZero() bool
func (JudgeActionPlayerNum) VDLReflect ¶
func (x JudgeActionPlayerNum) VDLReflect(vdlJudgeActionReflect)
type JudgeActionRoundResult ¶
type JudgeActionRoundResult struct{ Value Round } // The result of the previous round.
JudgeActionRoundResult represents field RoundResult of the JudgeAction union type.
func (JudgeActionRoundResult) Index ¶
func (x JudgeActionRoundResult) Index() int
func (JudgeActionRoundResult) Interface ¶
func (x JudgeActionRoundResult) Interface() interface{}
func (JudgeActionRoundResult) Name ¶
func (x JudgeActionRoundResult) Name() string
func (JudgeActionRoundResult) VDLIsZero ¶
func (x JudgeActionRoundResult) VDLIsZero() bool
func (JudgeActionRoundResult) VDLReflect ¶
func (x JudgeActionRoundResult) VDLReflect(vdlJudgeActionReflect)
type JudgeActionScore ¶
type JudgeActionScore struct{ Value ScoreCard } // The result of the game.
JudgeActionScore represents field Score of the JudgeAction union type.
func (JudgeActionScore) Index ¶
func (x JudgeActionScore) Index() int
func (JudgeActionScore) Interface ¶
func (x JudgeActionScore) Interface() interface{}
func (JudgeActionScore) Name ¶
func (x JudgeActionScore) Name() string
func (JudgeActionScore) VDLIsZero ¶
func (x JudgeActionScore) VDLIsZero() bool
func (JudgeActionScore) VDLReflect ¶
func (x JudgeActionScore) VDLReflect(vdlJudgeActionReflect)
type JudgeClientMethods ¶
type JudgeClientMethods interface { // CreateGame creates a new game with the given game options and returns a game // identifier that can be used by the players to join the game. CreateGame(_ *context.T, Opts GameOptions, _ ...rpc.CallOpt) (GameId, error) // Play lets a player join an existing game and play. Play(_ *context.T, Id GameId, _ ...rpc.CallOpt) (JudgePlayClientCall, error) }
JudgeClientMethods is the client interface containing Judge methods.
type JudgeClientStub ¶
type JudgeClientStub interface { JudgeClientMethods }
JudgeClientStub embeds JudgeClientMethods and is a placeholder for additional management operations.
func JudgeClient ¶
func JudgeClient(name string) JudgeClientStub
JudgeClient returns a client stub for Judge.
type JudgePlayClientCall ¶
type JudgePlayClientCall interface { JudgePlayClientStream // Finish performs the equivalent of SendStream().Close, then blocks until // the server is done, and returns the positional return values for the call. // // Finish returns immediately if the call has been canceled; depending on the // timing the output could either be an error signaling cancelation, or the // valid positional return values from the server. // // Calling Finish is mandatory for releasing stream resources, unless the call // has been canceled or any of the other methods return an error. Finish should // be called at most once. Finish() (PlayResult, error) }
JudgePlayClientCall represents the call returned from Judge.Play.
type JudgePlayClientStream ¶
type JudgePlayClientStream interface { // RecvStream returns the receiver side of the Judge.Play client stream. RecvStream() interface { // Advance stages an item so that it may be retrieved via Value. Returns // true iff there is an item to retrieve. Advance must be called before // Value is called. May block if an item is not available. Advance() bool // Value returns the item that was staged by Advance. May panic if Advance // returned false or was not called. Never blocks. Value() JudgeAction // Err returns any error encountered by Advance. Never blocks. Err() error } // SendStream returns the send side of the Judge.Play client stream. SendStream() interface { // Send places the item onto the output stream. Returns errors // encountered while sending, or if Send is called after Close or // the stream has been canceled. Blocks if there is no buffer // space; will unblock when buffer space is available or after // the stream has been canceled. Send(item PlayerAction) error // Close indicates to the server that no more items will be sent; // server Recv calls will receive io.EOF after all sent items. // This is an optional call - e.g. a client might call Close if it // needs to continue receiving items from the server after it's // done sending. Returns errors encountered while closing, or if // Close is called after the stream has been canceled. Like Send, // blocks if there is no buffer space available. Close() error } }
JudgePlayClientStream is the client stream for Judge.Play.
type JudgePlayServerCall ¶
type JudgePlayServerCall interface { rpc.ServerCall JudgePlayServerStream }
JudgePlayServerCall represents the context passed to Judge.Play.
type JudgePlayServerCallStub ¶
type JudgePlayServerCallStub struct { rpc.StreamServerCall // contains filtered or unexported fields }
JudgePlayServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements JudgePlayServerCall.
func (*JudgePlayServerCallStub) Init ¶
func (s *JudgePlayServerCallStub) Init(call rpc.StreamServerCall)
Init initializes JudgePlayServerCallStub from rpc.StreamServerCall.
func (*JudgePlayServerCallStub) RecvStream ¶
func (s *JudgePlayServerCallStub) RecvStream() interface { Advance() bool Value() PlayerAction Err() error }
RecvStream returns the receiver side of the Judge.Play server stream.
func (*JudgePlayServerCallStub) SendStream ¶
func (s *JudgePlayServerCallStub) SendStream() interface { Send(item JudgeAction) error }
SendStream returns the send side of the Judge.Play server stream.
type JudgePlayServerStream ¶
type JudgePlayServerStream interface { // RecvStream returns the receiver side of the Judge.Play server stream. RecvStream() interface { // Advance stages an item so that it may be retrieved via Value. Returns // true iff there is an item to retrieve. Advance must be called before // Value is called. May block if an item is not available. Advance() bool // Value returns the item that was staged by Advance. May panic if Advance // returned false or was not called. Never blocks. Value() PlayerAction // Err returns any error encountered by Advance. Never blocks. Err() error } // SendStream returns the send side of the Judge.Play server stream. SendStream() interface { // Send places the item onto the output stream. Returns errors encountered // while sending. Blocks if there is no buffer space; will unblock when // buffer space is available. Send(item JudgeAction) error } }
JudgePlayServerStream is the server stream for Judge.Play.
type JudgeServerMethods ¶
type JudgeServerMethods interface { // CreateGame creates a new game with the given game options and returns a game // identifier that can be used by the players to join the game. CreateGame(_ *context.T, _ rpc.ServerCall, Opts GameOptions) (GameId, error) // Play lets a player join an existing game and play. Play(_ *context.T, _ JudgePlayServerCall, Id GameId) (PlayResult, error) }
JudgeServerMethods is the interface a server writer implements for Judge.
type JudgeServerStub ¶
type JudgeServerStub interface { JudgeServerStubMethods // DescribeInterfaces the Judge interfaces. Describe__() []rpc.InterfaceDesc }
JudgeServerStub adds universal methods to JudgeServerStubMethods.
func JudgeServer ¶
func JudgeServer(impl JudgeServerMethods) JudgeServerStub
JudgeServer returns a server stub for Judge. It converts an implementation of JudgeServerMethods into an object that may be used by rpc.Server.
type JudgeServerStubMethods ¶
type JudgeServerStubMethods interface { // CreateGame creates a new game with the given game options and returns a game // identifier that can be used by the players to join the game. CreateGame(_ *context.T, _ rpc.ServerCall, Opts GameOptions) (GameId, error) // Play lets a player join an existing game and play. Play(_ *context.T, _ *JudgePlayServerCallStub, Id GameId) (PlayResult, error) }
JudgeServerStubMethods is the server interface containing Judge methods, as expected by rpc.Server. The only difference between this interface and JudgeServerMethods is the streaming methods.
type PlayResult ¶
type PlayResult struct {
YouWon bool // True if the player receiving the result won the game.
}
PlayResult is the value returned by the Play method. It indicates the outcome of the game.
func (PlayResult) VDLIsZero ¶
func (x PlayResult) VDLIsZero() bool
func (PlayResult) VDLReflect ¶
func (PlayResult) VDLReflect(struct { Name string `vdl:"v.io/x/ref/examples/rps.PlayResult"` })
type PlayerAction ¶
type PlayerAction interface { // Index returns the field index. Index() int // Interface returns the field value as an interface. Interface() interface{} // Name returns the field name. Name() string // VDLReflect describes the PlayerAction union type. VDLReflect(vdlPlayerActionReflect) VDLIsZero() bool VDLWrite(vdl.Encoder) error }
PlayerAction represents any single field of the PlayerAction union type.
type PlayerActionMove ¶
type PlayerActionMove struct{ Value string } // The move that the player wants to make.
PlayerActionMove represents field Move of the PlayerAction union type.
func (PlayerActionMove) Index ¶
func (x PlayerActionMove) Index() int
func (PlayerActionMove) Interface ¶
func (x PlayerActionMove) Interface() interface{}
func (PlayerActionMove) Name ¶
func (x PlayerActionMove) Name() string
func (PlayerActionMove) VDLIsZero ¶
func (x PlayerActionMove) VDLIsZero() bool
func (PlayerActionMove) VDLReflect ¶
func (x PlayerActionMove) VDLReflect(vdlPlayerActionReflect)
type PlayerActionQuit ¶
type PlayerActionQuit struct{ Value Unused } // Indicates that the player is quitting the game.
PlayerActionQuit represents field Quit of the PlayerAction union type.
func (PlayerActionQuit) Index ¶
func (x PlayerActionQuit) Index() int
func (PlayerActionQuit) Interface ¶
func (x PlayerActionQuit) Interface() interface{}
func (PlayerActionQuit) Name ¶
func (x PlayerActionQuit) Name() string
func (PlayerActionQuit) VDLIsZero ¶
func (x PlayerActionQuit) VDLIsZero() bool
func (PlayerActionQuit) VDLReflect ¶
func (x PlayerActionQuit) VDLReflect(vdlPlayerActionReflect)
type PlayerClientMethods ¶
type PlayerClientMethods interface { // Challenge is used by other players to challenge this player to a game. If // the challenge is accepted, the method returns nil. Challenge(_ *context.T, Address string, Id GameId, Opts GameOptions, _ ...rpc.CallOpt) error }
PlayerClientMethods is the client interface containing Player methods.
Player can receive challenges from other players.
type PlayerClientStub ¶
type PlayerClientStub interface { PlayerClientMethods }
PlayerClientStub embeds PlayerClientMethods and is a placeholder for additional management operations.
func PlayerClient ¶
func PlayerClient(name string) PlayerClientStub
PlayerClient returns a client stub for Player.
type PlayerServerMethods ¶
type PlayerServerMethods interface { // Challenge is used by other players to challenge this player to a game. If // the challenge is accepted, the method returns nil. Challenge(_ *context.T, _ rpc.ServerCall, Address string, Id GameId, Opts GameOptions) error }
PlayerServerMethods is the interface a server writer implements for Player.
Player can receive challenges from other players.
type PlayerServerStub ¶
type PlayerServerStub interface { PlayerServerStubMethods // DescribeInterfaces the Player interfaces. Describe__() []rpc.InterfaceDesc }
PlayerServerStub adds universal methods to PlayerServerStubMethods.
func PlayerServer ¶
func PlayerServer(impl PlayerServerMethods) PlayerServerStub
PlayerServer returns a server stub for Player. It converts an implementation of PlayerServerMethods into an object that may be used by rpc.Server.
type PlayerServerStubMethods ¶
type PlayerServerStubMethods PlayerServerMethods
PlayerServerStubMethods is the server interface containing Player methods, as expected by rpc.Server. There is no difference between this interface and PlayerServerMethods since there are no streaming methods.
type PlayersMoves ¶
type PlayersMoves [2]string
func (PlayersMoves) VDLIsZero ¶
func (x PlayersMoves) VDLIsZero() bool
func (PlayersMoves) VDLReflect ¶
func (PlayersMoves) VDLReflect(struct { Name string `vdl:"v.io/x/ref/examples/rps.PlayersMoves"` })
type RockPaperScissorsClientMethods ¶
type RockPaperScissorsClientMethods interface { JudgeClientMethods // Player can receive challenges from other players. PlayerClientMethods // ScoreKeeper receives the outcome of games from Judges. ScoreKeeperClientMethods }
RockPaperScissorsClientMethods is the client interface containing RockPaperScissors methods.
type RockPaperScissorsClientStub ¶
type RockPaperScissorsClientStub interface { RockPaperScissorsClientMethods }
RockPaperScissorsClientStub embeds RockPaperScissorsClientMethods and is a placeholder for additional management operations.
func RockPaperScissorsClient ¶
func RockPaperScissorsClient(name string) RockPaperScissorsClientStub
RockPaperScissorsClient returns a client stub for RockPaperScissors.
type RockPaperScissorsServerMethods ¶
type RockPaperScissorsServerMethods interface { JudgeServerMethods // Player can receive challenges from other players. PlayerServerMethods // ScoreKeeper receives the outcome of games from Judges. ScoreKeeperServerMethods }
RockPaperScissorsServerMethods is the interface a server writer implements for RockPaperScissors.
type RockPaperScissorsServerStub ¶
type RockPaperScissorsServerStub interface { RockPaperScissorsServerStubMethods // DescribeInterfaces the RockPaperScissors interfaces. Describe__() []rpc.InterfaceDesc }
RockPaperScissorsServerStub adds universal methods to RockPaperScissorsServerStubMethods.
func RockPaperScissorsServer ¶
func RockPaperScissorsServer(impl RockPaperScissorsServerMethods) RockPaperScissorsServerStub
RockPaperScissorsServer returns a server stub for RockPaperScissors. It converts an implementation of RockPaperScissorsServerMethods into an object that may be used by rpc.Server.
type RockPaperScissorsServerStubMethods ¶
type RockPaperScissorsServerStubMethods interface { JudgeServerStubMethods // Player can receive challenges from other players. PlayerServerStubMethods // ScoreKeeper receives the outcome of games from Judges. ScoreKeeperServerStubMethods }
RockPaperScissorsServerStubMethods is the server interface containing RockPaperScissors methods, as expected by rpc.Server. The only difference between this interface and RockPaperScissorsServerMethods is the streaming methods.
type Round ¶
type Round struct { Moves PlayersMoves // Each player's move. Comment string // A text comment from judge about the round. Winner WinnerTag // Who won the round. StartTime time.Time // The time at which the round started. EndTime time.Time // The time at which the round ended. }
Round represents the state of a round.
func (Round) VDLReflect ¶
type ScoreCard ¶
type ScoreCard struct { Opts GameOptions // The game options. Judge string // The name of the judge. Players []string // The name of the players. Rounds []Round // The outcome of each round. StartTime time.Time // The time at which the game started. EndTime time.Time // The time at which the game ended. Winner WinnerTag // Who won the game. }
func (ScoreCard) VDLReflect ¶
type ScoreKeeperClientMethods ¶
type ScoreKeeperClientMethods interface {
Record(_ *context.T, Score ScoreCard, _ ...rpc.CallOpt) error
}
ScoreKeeperClientMethods is the client interface containing ScoreKeeper methods.
ScoreKeeper receives the outcome of games from Judges.
type ScoreKeeperClientStub ¶
type ScoreKeeperClientStub interface { ScoreKeeperClientMethods }
ScoreKeeperClientStub embeds ScoreKeeperClientMethods and is a placeholder for additional management operations.
func ScoreKeeperClient ¶
func ScoreKeeperClient(name string) ScoreKeeperClientStub
ScoreKeeperClient returns a client stub for ScoreKeeper.
type ScoreKeeperServerMethods ¶
type ScoreKeeperServerMethods interface {
Record(_ *context.T, _ rpc.ServerCall, Score ScoreCard) error
}
ScoreKeeperServerMethods is the interface a server writer implements for ScoreKeeper.
ScoreKeeper receives the outcome of games from Judges.
type ScoreKeeperServerStub ¶
type ScoreKeeperServerStub interface { ScoreKeeperServerStubMethods // DescribeInterfaces the ScoreKeeper interfaces. Describe__() []rpc.InterfaceDesc }
ScoreKeeperServerStub adds universal methods to ScoreKeeperServerStubMethods.
func ScoreKeeperServer ¶
func ScoreKeeperServer(impl ScoreKeeperServerMethods) ScoreKeeperServerStub
ScoreKeeperServer returns a server stub for ScoreKeeper. It converts an implementation of ScoreKeeperServerMethods into an object that may be used by rpc.Server.
type ScoreKeeperServerStubMethods ¶
type ScoreKeeperServerStubMethods ScoreKeeperServerMethods
ScoreKeeperServerStubMethods is the server interface containing ScoreKeeper methods, as expected by rpc.Server. There is no difference between this interface and ScoreKeeperServerMethods since there are no streaming methods.
type Unused ¶
type Unused struct { }
TODO(toddw): Replace Unused with the unnamed empty struct{}.
func (Unused) VDLReflect ¶
type WinnerTag ¶
type WinnerTag byte
WinnerTag is a type used to indicate whether a round or a game was a draw, was won by player 1 or was won by player 2.
func (WinnerTag) VDLReflect ¶
Directories ¶
Path | Synopsis |
---|---|
Package internal defines common functions used by both rock paper scissors clients and servers.
|
Package internal defines common functions used by both rock paper scissors clients and servers. |
Command rpsbot repeatedly runs automated games, implementing all three roles.
|
Command rpsbot repeatedly runs automated games, implementing all three roles. |
Command rpsplayer implements the Player interface, which enables a human to play the game.
|
Command rpsplayer implements the Player interface, which enables a human to play the game. |
Command rpsscorekeeper implements the ScoreKeeper interface.
|
Command rpsscorekeeper implements the ScoreKeeper interface. |