package cardsim func RunSimpleTerminalUI[C StatsCollection](p *Player[C]) error { for { err := p.StartNextTurn() if p.DebugLevel < 1 && IsSeriousError(err) { return err } p.ReportError(err) for p.CanAct() { isCard, cardIdx, choiceIdx := pickNextAction(p) var msg Message if isCard { msg, err = p.EnactCard(cardIdx, choiceIdx) } else { msg, err = p.EnactPermanentAction(cardIdx, choiceIdx) } p.ReportError(err) if p.DebugLevel < 1 && IsSeriousError(err) { return err } displayAndWait(msg) } review(p) err = p.Simulate() if p.DebugLevel < 1 && IsSeriousError(err) { return err } if p.DebugLevel < 1 && p.State.Over() { return nil } } return nil }