private int?MoveDown(int currentNo, List <int> sequence) { int?nextNo = currentNo; do { nextNo = Keypad.DownOf(nextNo.Value); if (nextNo.HasValue && !sequence.Contains(nextNo.Value)) { break; } }while (nextNo.HasValue); return(nextNo); }
private int?MoveLeftDown(int currentNo, List <int> sequence) { int?nextNo = Keypad.LeftOf(currentNo); if (nextNo.HasValue) { nextNo = Keypad.DownOf(nextNo.Value); if (nextNo.HasValue && sequence.Contains(nextNo.Value)) { nextNo = null; } } return(nextNo); }
private int?MoveDownRight(int currentNo, List <int> sequence) { int?nextNo = Keypad.DownOf(currentNo); if (nextNo.HasValue) { nextNo = Keypad.DownOf(nextNo.Value); if (nextNo.HasValue) { nextNo = Keypad.RightOf(nextNo.Value); if (nextNo.HasValue && !sequence.Contains(nextNo.Value)) { return(nextNo); } } } return(null); }