readSudoku              package:sudoku              R Documentation

_R_e_a_d _a _F_i_l_e _C_o_n_t_a_i_n_i_n_g _a _S_u_d_o_k_u _G_r_i_d

_D_e_s_c_r_i_p_t_i_o_n:

     Reads a file containing a Sudoku grid (a 9x9 matrix).

_U_s_a_g_e:

       readSudoku(fn, map)

_A_r_g_u_m_e_n_t_s:

      fn: A filename.

     map: Vector of unique puzzle elements (possibly longer than
          necessary).  The default is 'c(1:9, letters)', so an N=16
          puzzle should be encoded using '1'-'9' and 'a'-'g'.

_D_e_t_a_i_l_s:

     The input file should look like this:


     -6-1-4-5-
     --83-56--
     2-------1
     8--4-7--6
     --6---3--
     7--9-1--4
     5-------2
     --72-69--
     -4-5-8-7-

     Blank cells can be indicated with any character not in "map", such
     as the '-' used here.

_V_a_l_u_e:

     A numeric matrix (usually 9x9).

_A_u_t_h_o_r(_s):

     David E. Brahm <brahm@alum.mit.edu>

_E_x_a_m_p_l_e_s:

       z <- readSudoku(system.file("puz1.txt", package="sudoku"))

