package spells import "math/rand" var spells = []string{ `Slime Finger`, `Rabbit Punch`, `Hastiness`, `Good Move`, `Sadness`, `Seasick`, `Gyp`, `Shoelaces`, `Innoculate`, `Cone of Annoyance`, `Magnetic Orb`, `Invisible Hands`, `Revolting Cloud`, `Aqueous Humor`, `Spectral Miasma`, `Clever Fellow`, `Lockjaw`, `History Lesson`, `Hydrophobia`, `Big Sister`, `Cone of Paste`, `Mulligan`, `Nestor's Bright Idea`, `Holy Batpole`, `Tumor (Benign)`, `Braingate`, `Nonplus`, `Animate Nightstand`, `Eye of the Troglodyte`, `Curse Name`, `Dropsy`, `Vitreous Humor`, `Roger's Grand Illusion`, `Covet`, `Astral Miasma`, `Spectral Oyster`, `Acrid Hands`, `Angioplasty`, `Grognor's Big Day Off`, `Tumor (Malignant)`, `Animate Tunic`, `Ursine Armor`, `Holy Roller`, `Tonsilectomy`, `Curse Family`, `Infinite Confusion`, } func Pick() string { n := rand.Intn(len(spells)) return spells[n] } type SpellBook struct { Spells []Spell } type Spell struct { Title string Level int } func (m *SpellBook) Add(title string) { for i, v := range m.Spells { if v.Title == title { v.Level += 1 m.Spells[i] = v return } } m.Spells = append(m.Spells, Spell{Title: title, Level: 1}) }