public static Document CreateJapanHouse() { Document document = new Document(7, 7); int[,] filledCells2 = { {0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0}, {1, 1, 0, 0, 0, 1, 1}, {0, 1, 0, 0, 0, 1, 0}, {0, 1, 0, 0, 0, 1, 0}, {0, 1, 1, 1, 1, 1, 0} }; for(int i = 0; i < filledCells2.GetLength(0); i++) { for(int j = 0; j < filledCells2.GetLength(1); j++) { document.Map.Cells[i, j].State = (filledCells2[i, j] > 0 ? CellStateEnum.Filled : CellStateEnum.Normal); } } document.RebuildDigitGroupCollectionsFromMap(); return document; }
public static Document CreateRandomDocument(int width, int height) { Document document = new Document(width, height); Random r = new Random(); //((i + j) % 2 == 0) //(r.NextDouble() < 0.6) //(i > j) DocumentGenerator.GenerateRandomCells(document, (i, j) => ((i + j) % 2 == 0)); document.RebuildDigitGroupCollectionsFromMap(); return document; }