Suduko

Im trying to make a suduko puzzle solver and my current input takes to long. I want the user to be able to enter the input. I use int Board[9][9] to represent the board. 0,0 is the bottom left. I currently ask for each number and its oordinates. Does anyone have a better idea for input?
Have the user copy his sudoku to a text file, then read the textfile. Set empty boxes as 0.
u can use keyboard interrupt.....for which u require the following:
#include<dos.h>
int ascii,scan;
1
2
3
4
5
6
7
8
9
void getkey(void)
{
union REGS ii,oo;
while(!(kbhit())
;ii.x.al=0;
int86(22,&ii,&oo);
ascii=oo.x.al;
scan=oo.x.ah;
}

by calling the function getkey() and then collecting scan value of the arrow keys of pressed key.respective scan values of the keys are
up-arrow=72; down-arrow=80;left-arrow=75;right-arrow=77;
then we use an infinite while loop as follows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
int c_row,c_column;int a[9][9]={0};
while(12)
{getkey();
if(scan==72)
{ 
          if(c_row!=0)
          {
          c_row--;
           if(a[c_row][c_column]==0)
                      {printf(" ");
                       scanf("%d",&a[c_row][c_column]);
                       display_screen(); 
          }
}
if(scan==80)
{
        if(c_row!=9)
          {
          c_row++;
           if(a[c_row][c_column]==0)
                      {printf(" ");
                       scanf("%d",&a[c_row][c_column]);
                       display_screen(); 
          }


}
if(scan==75)//left arrow......c_column--;
{
        if(c_column!=0)
          {
          c_column--;
           if(a[c_row][c_column]==0)
                      {printf(" ");
                       scanf("%d",&a[c_row][c_column]);
                       display_screen(); 
          }


}
if(scan==77)//right arrow........c_column++
{
        if(c_column!=9)
          {
          c_column++;
           if(a[c_row][c_column]==0)
                      {printf(" ");
                       scanf("%d",&a[c_row][c_column]);
                       display_screen(); 
          }


}

}
void display_screen()
{

}
ask if u require the rest of code............
Topic archived. No new replies allowed.