Hello again.
It's funny how simply writing down a question gets me focused on
answering it myself.
I got myself a little clearer on what "ARGF.readlines" does, so now
puts
Sudoku.solve(Sudoku::Puzzle.new(ARGF.readlines))
makes more sense.
I copied the code lines from the comments of the O'Reilly Sudoku
Solver into
a file named SolveSudoku.rb:
# SolveSudoku.rb
#
# Script to solve a Sudoku puzzle
# sudoku.rb (O'Reilly Sudoku Solver code) must be in same directory
require 'sudoku'
puts Sudoku.solve(Sudoku::Puzzle.new(ARGF.readlines))
Then I opened a command prompt in the directory containing all the
code and
my text files containing Sudoku puzzles to be solved.
At the command line I typed in
> ruby SolveSudoku.rb "Easy01.txt"
(the argument "Easy01.txt" is a file containing an incomplete Sudoku
puzzle)
The argument tells SolveSudoku.rb what to look at and solve.
I got an error about "Duplicates in Puzzle" so I went back and read
everything again.
In my text file I was putting zeroes (0) to indicate an unknown cell
in the puzzle,
but actually a period (.) is required.
The code saw more than one zero in a line and threw an exception, just
like the code says it will.
One little "Aha!" moment is all it takes to begin learning. My whole
life is a series of "Aha!" moments.