public NumsPosition(NumsNum firstPlayerNum, NumsNum secondPlayerNum) { FirstPlayerNumber = firstPlayerNum; FirstPlayerMoves = new List <NumsMove>(); SecondPlayerNumber = secondPlayerNum; SecondPlayerMoves = new List <NumsMove>(); PlayerToMakeMove = 1; }
public NumsPosition() { FirstPlayerNumber = new NumsNum(0); FirstPlayerMoves = new List <NumsMove>(); SecondPlayerNumber = new NumsNum(0); SecondPlayerMoves = new List <NumsMove>(); PlayerToMakeMove = 1; }
public static bool IsCorrect(this int num) { if ((num < 01234) || (num > 98765)) { return(false); } var digits = NumsNum.NumToDigits(num); return((digits[0] != digits[1]) && (digits[0] != digits[2]) && (digits[0] != digits[3]) && (digits[0] != digits[4]) && (digits[1] != digits[2]) && (digits[1] != digits[3]) && (digits[1] != digits[4]) && (digits[2] != digits[3]) && (digits[2] != digits[4]) && (digits[3] != digits[4])); }
public static NumsCount GetCountFrom(this NumsNum move, NumsNum playerNumber) { var result = new NumsCount(); for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { if (move.Digits[i] == playerNumber.Digits[j]) { result.First++; if (i == j) { result.Second++; } } } } return(result); }