public static int scoreCounter(int curretLine, int num) { int curretScore = 0; if (field[curretLine] == 255) { ModifyBitsU mBU = new ModifyBitsU((ulong)num); for (int i = 0; i < 8; i++) { if (mBU.GetBitValue(i)) { curretScore++; } } curretScore *= 10; } else { ModifyBitsU mBU = new ModifyBitsU((ulong)field[curretLine]); for (int i = 0; i < 8; i++) { if (mBU.GetBitValue(i)) { curretScore++; } } } return(curretScore); }
public static bool leftMoveChecker(byte number) { bool lMoveIsPossible = false; ModifyBitsU mBU = new ModifyBitsU((ulong)number); if (!mBU.GetBitValue(7)) { lMoveIsPossible = true; } return(lMoveIsPossible); }
public static bool downMoveChecker(byte number, byte nextNumber) { bool dMoveIsPossible = true; ModifyBitsU mbuNumber = new ModifyBitsU((ulong)number); ModifyBitsU mbuNextNumber = new ModifyBitsU((ulong)nextNumber); for (int i = 0; i < 8; i++) { bool numBitVal = mbuNumber.GetBitValue(i); bool numNextBitVal = mbuNextNumber.GetBitValue(i); if (numBitVal && numNextBitVal) { dMoveIsPossible = false; break; } } return(dMoveIsPossible); }