game

package
v0.0.0-...-6e231dc Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GameNames = []string{"Mamadou", "Abdoulaye", "Aminata", "Oumou",
	"Lethabo", "Siphosethu", "Melokuhle", "Amadou",
	"Mateo", "Noah", "Emma", "Catalina",
	"José", "Miguel", "Maria", "Helena",
	"Santiago", "Emiliano", "Sofía", "Camila",
	"Liam", "Oliver", "Eli", "Henry", "Ben", "James", "Robert", "Bill", "Richard", "Joe", "Olivia", "Charlotte", "Sophia", "Ava", "Evelyn", "Mary", "Linda", "Elizabeth", "Susan", "Margaret",
	"Mohamed", "Ali", "Omar", "Khaled", "Maryam", "Hur", "Malak", "Farah",
	"Mùchén", "Yǔzé", "Ruòxī", "Yǐmò",
	"Shivansh", "Kabir", "Kiaan", "Viraj", "Aditi", "Kiara", "Vamika", "Mehav",
	"David", "Eitan", "Avigail", "Maya",
	"Aoi", "Haruto", "Himari", "Anzu",
	"Jacob", "Angelo", "Althea", "Nathalie",
	"Seo-jun", "Ju-won", "Ji-an", "Ha-rin",
	"Noel", "Mateo", "Amelie", "Ambra",
	"Luka", "Petar", "Lucija", "Marta",
	"Gabriel", "Maël", "Jade", "Lina",
	"Elias", "Theo", "Mia", "Ella",
	"Leonardo", "Mattia", "Aurora", "Alice",
	"Jack", "Hudson", "Isla", "Matilda"}

Functions

func BluffCheck

func BluffCheck(input string) string

func CheckEndOfTurn

func CheckEndOfTurn(players []Player, underTheGun int, turns *int) bool

func DetermineWinners

func DetermineWinners(hands []card.HandStrength) []int

Compares every player's best hand and determines the winner(s).

func DetermineWinnersSide

func DetermineWinnersSide(hands []card.HandStrength) ([]int, []int)

Compares every player's best hand and determines the winner(s).

func GenerateName

func GenerateName(amount int) ([]string, error)

Generates robot names. Should only be called from the game package.

func PrepareRunningGame

func PrepareRunningGame()

func PrintState

func PrintState(deal Deal)

func ReadHand

func ReadHand(pl Player) (string, string)

func RobotTurn

func RobotTurn(robot Player, playerNumber int, community []card.Card, amount int) (string, error)

func RunDeal

func RunDeal(deal *Deal)

func RunGame

func RunGame(set ux.Settings)

Types

type Deal

type Deal struct {
	Winners []Player //Who won the deal
	// contains filtered or unexported fields
}

func BuildDeal

func BuildDeal(g GameInstance) (Deal, error)

Initializes deal object

func (Deal) CheckWinner

func (d Deal) CheckWinner() []Player

func (*Deal) DealHands

func (d *Deal) DealHands() error

type GameInstance

type GameInstance struct {
	// contains filtered or unexported fields
}

func BuildGame

func BuildGame(set ux.Settings) (GameInstance, error)

Initializes game object with number of players "pnum" and level of bots "level".

type Player

type Player struct {
	Name string //Name of the player

	Hand      [2]card.Card //The hole cards of the player.
	Chips     int          //How many chips the player has.
	Bet       int          //The player's bet
	HasFolded bool         //Whether the player has folded in a particular deal.
	HasRaised bool         //Whether the player has raised in a particular deal.
	// contains filtered or unexported fields
}

func (Player) GetId

func (p Player) GetId() int

func (Player) GetLevel

func (p Player) GetLevel() int

func (*Player) Turn

func (p *Player) Turn(deal *Deal) error

Jump to

Keyboard shortcuts

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