示例#1
0
        private int?MoveUp(int currentNo, List <int> sequence)
        {
            int?nextNo = currentNo;

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

            return(nextNo);
        }
示例#2
0
        private int?MoveLeftUp(int currentNo, List <int> sequence)
        {
            int?nextNo = Keypad.LeftOf(currentNo);

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

            return(nextNo);
        }
示例#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);
        }