// Copyright (c) 2016 Florian Fischer. All rights reserved. // Use of this source code is governed by a MIT license found in the LICENSE file. package logic type Player struct { Name string Score Score } func NewPlayer(name string) Player { return Player{name, NewScore()} } func FindBest(players []Player) ([]Player, int) { best := []Player{} max := 0 for _, p := range players { t := p.Score.Score() if t > max { best = []Player{p} max = t } else if t == max { best = append(best, p) } } return best, max }