User Tools

Site Tools


the_eight_queens_solver

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
the_eight_queens_solver [2012/02/21 11:48] xjiathe_eight_queens_solver [2012/02/23 14:02] (current) xjia
Line 2: Line 2:
 /* The eight queens solver */ /* The eight queens solver */
  
-int main(string[] args) {+int main(string[ ] args) {
   int N;   int N;
   int[] row, col;   int[] row, col;
Line 14: Line 14:
   d[1] = new int[N+N-1];   d[1] = new int[N+N-1];
      
 +  // fillIntArray is a contributed function
   fillIntArray(row, 0);   fillIntArray(row, 0);
   fillIntArray(col, 0);   fillIntArray(col, 0);
Line 35: Line 36:
       }       }
     }     }
-    printLine("");+    printChar('\n');
   }   }
-  printLine("")+  printChar('\n');
-  return 0;+
 } }
  
Line 56: Line 56:
     }     }
   }   }
-  return 0; 
 } }
 +</code>
  
-void fillIntArray(int[] a, int v) { +Note that ''fillIntArray'' is a [[contributed_functions|contributed function]].
-  int i; +
-  +
-  for (i = 0; i < a.length; i = i+1) { +
-    a[i] = v; +
-  } +
-+
-</code>+
the_eight_queens_solver.1329824916.txt.gz · Last modified: 2012/02/21 11:48 by xjia

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki