public bool Init(Board inBoard) { bool ok = true; FillValuesWithRange(); for (int i = 0; i < 9 && ok; ++i) if (!inBoard.IsAvailable(i, mRowIndex)) ok = AssignValue(inBoard.Get(i, mRowIndex)); return ok; }
public bool Init(Board inBoard) { bool ok = true; FillValuesWithRange(); if (mTopToBottom) { for (int i = 0; i < 9 && ok; ++i) if (!inBoard.IsAvailable(i,i)) ok = AssignValue(inBoard.Get(i,i)); } else { for (int i = 0; i < 9 && ok; ++i) if (!inBoard.IsAvailable(i, 8 - i)) ok = AssignValue(inBoard.Get(i, 8 - i)); } return ok; }
public bool Init(Board inBoard) { bool ok = true; FillValuesWithRange(); for (int i = 0; i < 3 && ok; ++i) for (int j = 0; j < 3 && ok; ++j) if (!inBoard.IsAvailable(i + mLeftColumn, j + mTopRow)) ok = AssignValue(inBoard.Get(i + mLeftColumn, j + mTopRow)); return ok; }
private bool FillDataWithBoard(StreamWriter inData,Board inBoard) { for(int i=0;i<9;++i) { for(int j=0;j<9;++j) { inData.Write(inBoard.Get(i,j).ToString()); } inData.Write(inData.NewLine); } return true; }
void ShowNumber(TextBox inTextBox,Board inBoard) { int tagNumber = Int32.Parse((string)(inTextBox.Tag)); int result = inBoard.Get(tagNumber / 9, tagNumber % 9); if(result != Board.EMPTY_CELL_VALUE) inTextBox.Text = result.ToString(); else inTextBox.Text = String.Empty; }