I just can not understand the backdate arithmeticfor example:can you give me
some tips: #include<stdio.h>void search(int row,int column);/*function
antetype*/
int check(int i,int j,int k,int a[][12]);char
labyrinth[12][12]={{'#','#','#','#','#','#','#','#','#','#','#','#'},{'#','.','.','.','#','.','.','.','.','.','.','#'},
{'.','.','#','.','#','.','#','#','#','#','.','#'},{'#','#','#','.','#','.','.','.','.','#','.','#'},{'#','.','.','.','.','#','#','#','.','#','.','.'},
{'#','#','#','#','.','#','.','#','.','#','.','#'},{'#','.','.','#','.','#','.','#','.','#','.','#'},{'#','#','.','#','.','#','.','#','.','#','.','#'},
{'#','.','.','.','.','.','.','.','.','#','.','#'},{'#','#','#','#','#','#','.','#','#','#','.','#'},{'#','.','.','.','.','.','.','#','.','.','.','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#'}};int fx[4]={1,-1,0,0};
int fy[4]={0,0,1,-1};
int main()/*begin main*/
{ search(2,0); return 0;}/*end main*/
void search(int row,int column)
{ int i;/*caculation on the row*/
int j;/*caculation on the column*/
int newrow;/*new row coordinate*/
int newcolumn;/*new column coordinate*/
int a[12][12]={0};
int k; for(i=0;i<=11;i++){
for(j=0;j<=11;j++){
if(labyrinth[i][j]=='#'){
a[i][j]=1;
}
}
} for(k=0;k<=3;k++){
if(check(row,column,k,a)==1){
newrow=i+fx[k];
newcolumn=j+fy[k];
labyrinth[newrow][newcolumn]=3;
if(newrow==4&&newcolumn==11){
for(i=0;i<=11;i++){
for(j=0;j<=11;j++){
printf("%d",a[i][j]);
}
printf("\n");
}
}
else{
search(newrow,newcolumn);
}
}
a[row][column]=0;
}
}int check(int i,int j,int k,int a[][12]){ int judgement=1; i=i+fx[i];
j=j+fy[j]; if(i<=0||i>=8||j<=0||j>=8){
judgement=0;
}
else{
if(a[i][j]!=0){
judgement=0;
}
} return judgement;}
--
ŬÁ¦ ÎÒ²»ÏëÈñðÈËÐ¡ÇÆÎÒ ¼ÇסŶ....
[Non-text portions of this message have been removed]
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/c-prog/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/