FilesSubmittedBranchesLabelsClientsUsersJobsHelp
Tree viewShow/hide recent activityInformation
Change 156

Change 156 by ksimpson@ksimpson-tibook on 2005/06/01 19:44:05

treat anything that isn't 1-9 as a blank. puzzles pasted off the newspaper site use '_' and we were happily putting 47s in the grid.
Jobs fixed ...Affected files ...
//depot/projects/sudoku/main/sudoku.c#3 edittext
Differences ...

==== //depot/projects/sudoku/main/sudoku.c#3 (text) ====

@@ -61,8 +61,9 @@
6161 while (r < 9 && fgets(line, sizeof line, f)) {
6262 if (line[0] == '#' || line[0] == '\n')
6363 continue;
64 /* anything that isn't 1-9 is a blank: '.', '0', '_', ' ' (job000005) */
6465 for (c = 0; c < 9; c++)
65 grid[r][c] = (line[c] == '.') ? 0 : line[c] - '0';
66 grid[r][c] = (line[c] >= '1' && line[c] <= '9') ? line[c] - '0' : 0;
6667 r++;
6768 }
6869 return r == 9;

P4Web/LINUX26X86/2005.1/82295 · Copyright © 1995-2005 Perforce Software · ttul.org