コード例 #1
0
 protected void openSudoku(object sender, EventArgs e)
 {
     Sudoku currentSudoku = null;
     HttpPostedFile file = Request.Files["sudokuTextFile"];
     if (file != null && file.ContentLength > 0)
     {
         SudokuSolver sudokuSolver = new SudokuSolver();
         currentSudoku = sudokuSolver.OpenSudoku(file);
         Session["currentSudoku"] = currentSudoku;
     }
     writeSudoku(currentSudoku);
 }
コード例 #2
0
 protected void solveSudoku(object sender, EventArgs e)
 {
     Sudoku currentSudoku = (Sudoku)Session["currentSudoku"];
     if (currentSudoku != null)
     {
         SudokuSolver sudokuSolver = new SudokuSolver();
         currentSudoku = sudokuSolver.SolveSudoku(currentSudoku);
         writeSudoku(currentSudoku);
     }
     else
     {
         popupAlert("Please open Sudoku before trying to solve.");
     }
 }