Esempio n. 1
0
        /// <summary>
        /// Finds the number of numbers of the guess that are in the correct position.
        /// </summary>
        /// <param name="theGuess">The guessed combo.</param>
        /// <param name="theActual">The actual combo.</param>
        /// <returns>The number correct.</returns>
        public static int FindNumberCorrect(Combo theGuess, Combo theActual)
        {
            int count = 0;

            for (int i = 0; i < theGuess.ComboSize; i++)
            {
                if (theGuess.NumberAtPosition(i) == theActual.NumberAtPosition(i))
                {
                    count++;
                }
            }

            return count;
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a combo based of another combo.
 /// </summary>
 /// <param name="combo">The combo.</param>
 public Combo(Combo combo)
     : this(combo.ComboList)
 {
 }
Esempio n. 3
0
 /// <summary>
 /// The compare method that gives a solution.
 /// </summary>
 /// <param name="theGuess">The guessed combo.</param>
 /// <param name="theActual">The actual combo.</param>
 /// <returns>The solution.</returns>
 public static Solution Compare(Combo theGuess, Combo theActual)
 {
     return new Solution(FindNumberCorrect(theGuess, theActual),
         0,
         0);
 }