Beispiel #1
0
        private int?MoveDownLeft(int currentNo, List <int> sequence)
        {
            int?nextNo = Keypad.DownOf(currentNo);

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

            return(null);
        }
Beispiel #2
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);
        }