game

package
v0.0.0-...-8fa2ce1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ingredient = "ingredient"
	Special    = "special"
)

Constants for all supported card types

View Source
const (
	Flour          = "Flour"
	Sugar          = "Sugar"
	Eggs           = "Eggs"
	Butter         = "Butter"
	Chocolate      = "Chocolate"
	Vanilla        = "Vanilla"
	Berries        = "Berries"
	CreamCheese    = "Cream Cheese"
	Honey          = "Honey"
	DarkChocolate  = "Dark Chocolate"
	EdibleGoldLeaf = "Edible Gold Leaf"
)

Constants for all supported ingredient types

View Source
const (
	WildcardIngredient = "Wildcard Ingredient"
	DoublePoints       = "Double Points"
	MysteryIngredient  = "Mystery Ingredient"
	StealCard          = "Steal Card"
	RefreshPantry      = "Refresh Pantry"
	GlassOfMilk        = "Glass of Milk"
)

Constants for all supported special cards

View Source
const (
	Cake                    = "Cake"
	Pie                     = "Pie"
	ChocolateChipCookies    = "Chocolate Chip Cookies"
	Cheesecake              = "Cheesecake"
	MarbleCake              = "Marble Cake"
	TripleChocolateBrownies = "Triple Chocolate Brownies"
	GourmetTruffles         = "Gourmet Truffles"
	RaspberryChocCheesecake = "Raspberry Chocolate Cheesecake"
	GoldLeafCupcakes        = "Gold Leaf Cupcakes"
)

Constants for all supported dessert types

View Source
const (
	WinningScore = 100
)

Variables

View Source
var DessertPointsMap = map[string]int32{
	"Cake":                           10,
	"Pie":                            15,
	"Chocolate Chip Cookies":         20,
	"Cheesecake":                     25,
	"Marble Cake":                    30,
	"Triple Chocolate Brownies":      35,
	"Gourmet Truffles":               40,
	"Raspberry Chocolate Cheesecake": 45,
	"Gold Leaf Cupcakes":             50,
}

DessertPointsMap holds the points for each dessert type.

Functions

func CalculateDessertScore

func CalculateDessertScore(dessertName string, ingredientsList []string, specialCard string) (int32, error)

CalculateDessertScore calculates the score for a dessert based on ingredients and special cards.

func GetDessertPoints

func GetDessertPoints(dessertName string) (int32, bool)

GetDessertPoints returns the points for a given dessert.

func GetRequiredIngredientsForDessert

func GetRequiredIngredientsForDessert(dessertType string) ([]string, error)

GetRequiredIngredientsForDessert returns the required ingredients for a given dessert

func IsGameWon

func IsGameWon(score int32) bool

func IsSupportedCardype

func IsSupportedCardype(card_type string) bool

IsSupportedCardType returns true if the card type is supported

func IsSupportedDessertType

func IsSupportedDessertType(dessertType string) bool

IsSupportedDessertType returns true if the dessert type is supported

func IsSupportedIngredientType

func IsSupportedIngredientType(ingredientType string) bool

IsSupportedIngredientType returns true if the ingredient type is supported

func IsSupportedSpecialCardType

func IsSupportedSpecialCardType(specialCardType string) bool

IsSupportedSpecialCardType returns true if the special card type is supported

func ProcessSpecialCards

func ProcessSpecialCards(specialCard string) (int32, int32)

ProcessSpecialCards processes the special cards and returns score modifiers.

func ValidateDessert

func ValidateDessert(dessertName string, ingredientCards []string) error

ValidateDessert validates if a dessert is valid based on game rules

Types

This section is empty.

Jump to

Keyboard shortcuts

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