Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateDessertScore(dessertName string, ingredientsList []string, specialCard string) (int32, error)
- func GetDessertPoints(dessertName string) (int32, bool)
- func GetRequiredIngredientsForDessert(dessertType string) ([]string, error)
- func IsGameWon(score int32) bool
- func IsSupportedCardype(card_type string) bool
- func IsSupportedDessertType(dessertType string) bool
- func IsSupportedIngredientType(ingredientType string) bool
- func IsSupportedSpecialCardType(specialCardType string) bool
- func ProcessSpecialCards(specialCard string) (int32, int32)
- func ValidateDessert(dessertName string, ingredientCards []string) error
Constants ¶
const ( Ingredient = "ingredient" Special = "special" )
Constants for all supported card types
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
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
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
const (
WinningScore = 100
)
Variables ¶
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 ¶
GetDessertPoints returns the points for a given dessert.
func GetRequiredIngredientsForDessert ¶
GetRequiredIngredientsForDessert returns the required ingredients for a given dessert
func IsSupportedCardype ¶
IsSupportedCardType returns true if the card type is supported
func IsSupportedDessertType ¶
IsSupportedDessertType returns true if the dessert type is supported
func IsSupportedIngredientType ¶
IsSupportedIngredientType returns true if the ingredient type is supported
func IsSupportedSpecialCardType ¶
IsSupportedSpecialCardType returns true if the special card type is supported
func ProcessSpecialCards ¶
ProcessSpecialCards processes the special cards and returns score modifiers.
func ValidateDessert ¶
ValidateDessert validates if a dessert is valid based on game rules
Types ¶
This section is empty.