Documentation ¶
Index ¶
Constants ¶
const ( GameEntry = `entry` GameEP = `ep` )
Is it an entry round or an EP round?
const ( // SpecialChars collects characters that shouldn't be turned into '_' SpecialChars string = `"[]-(),.:;?!'& /_\` )
Variables ¶
This section is empty.
Functions ¶
func CreateBlankName ¶
CreateBlankName generates a string in which each character is replaced with a '_', except for the SpecialChars.
func ReplaceLetter ¶
ReplaceLetter inserts each occurence of the given letter in name on blankName.
func ReplaceWord ¶
ReplaceWord inserts the first occurence of the given word in name on blankName.
Types ¶
type EP ¶
EP holds plenty of entries while also being an entry itself.
func (*EP) GuessLetter ¶
GuessLetter tries to fill all instance of the given letter in all the entries' BlankName.
type Entry ¶
type Entry struct { Player // Usually the song or album's name Title string `json:"title"` // This represents the title as a sequence of "_", ready to be filled BlankTitle string `json:"blank_title"` }
Entry represents a song, or album sent by a player.
func (*Entry) GuessLetter ¶
GuessLetter tries to fill all instances of the given letter in the entry's BlankTitle. If it's already been guessed, nothing happens.
type Game ¶
type Game struct {
Category string `json:"category"`
}
Game represents the currently running game
type Guesses ¶
type Guesses struct { Letters []string `json:"letters"` Words []string `json:"words"` Players []Player `json:"players_guessing"` MaxTurns int `json:"max_turns"` }
Guesses keeps track of the many guesses players make during the game.
func NewGuesses ¶
NewGuesses returns a pointer to a Guesses type, with the given MaxTurns. If missing or given 0, it defaults to 3.
func (*Guesses) AddPlayer ¶
AddPlayer a player to the end of a turn queue, and removes the first one.
func (*Guesses) RepeatedLetter ¶
RepeatedLetter checks if a given letter exists in the list of guesses.
func (*Guesses) RepeatedWord ¶
RepeatedWord checks if a word exists in the list of guesses.