Exemple #1
0
        /// <summary>
        /// Return the next valid digit from the current digit, based on this move
        /// </summary>
        /// <param name="currentNo"></param>
        /// <param name="sequence"></param>
        /// <returns></returns>
        private int?MoveRight(int currentNo, List <int> sequence)
        {
            int?nextNo = currentNo;

            do
            {
                nextNo = Keypad.RightOf(nextNo.Value);
                if (nextNo.HasValue && !sequence.Contains(nextNo.Value))
                {
                    break;
                }
            }while (nextNo.HasValue);

            return(nextNo);
        }
Exemple #2
0
        private int?MoveRightDown(int currentNo, List <int> sequence)
        {
            int?nextNo = Keypad.RightOf(currentNo);

            if (nextNo.HasValue)
            {
                nextNo = Keypad.DownOf(nextNo.Value);
                if (nextNo.HasValue && sequence.Contains(nextNo.Value))
                {
                    nextNo = null;
                }
            }

            return(nextNo);
        }
Exemple #3
0
        private int?MoveUpRight(int currentNo, List <int> sequence)
        {
            int?nextNo = Keypad.UpOf(currentNo);

            if (nextNo.HasValue)
            {
                nextNo = Keypad.UpOf(nextNo.Value);
                if (nextNo.HasValue)
                {
                    nextNo = Keypad.RightOf(nextNo.Value);
                    if (nextNo.HasValue && !sequence.Contains(nextNo.Value))
                    {
                        return(nextNo);
                    }
                }
            }

            return(null);
        }