Ejemplo n.º 1
0
        public void Replay()
        {
            var playedMoves = new PlayedMoves();

            playedMoves.Add(new Divide(3));

            Assert.Equal(3, playedMoves.Replay(9));
        }
Ejemplo n.º 2
0
        public void ReplayWithMultiple()
        {
            var playedMoves = new PlayedMoves();

            playedMoves.Add(new Divide(3));
            playedMoves.Add(new Add(4));

            Assert.Equal(7, playedMoves.Replay(9));
        }
Ejemplo n.º 3
0
        private static PlayedMoves CreatePossibleSolution(int start, int goal, int maxMoves, List <IMove> possibleMoves)
        {
            var rand   = new Random();
            var result = new PlayedMoves();

            for (int i = 0; i < maxMoves; i++)
            {
                var move = possibleMoves[rand.Next(possibleMoves.Count)];
                result.Add(move);
            }
            return(result);
        }