예제 #1
0
        public string rps_game_winner(List <List <string> > game)
        {
            _gameValidator.Validate(game);

            var winner = _engine.GetWinner(game[0], game[1]);

            return(FormatWinnerResponse.Format(winner));
        }
예제 #2
0
        public List <string> PlayBracket(List <List <List <string> > > bracket)
        {
            var subBracketWinner = new List <List <string> >();

            foreach (var subBracket in bracket)
            {
                _gameValidator.Validate(subBracket);
                subBracketWinner.Add(_engine.GetWinner(subBracket[0], subBracket[1]));
            }

            if (subBracketWinner.Count > 1)
            {
                return(PlayBracket(MakeNewBracket(subBracketWinner)));
            }

            return(subBracketWinner[0]);
        }