Sha256: 2c8212f3f9aede17e16f88b77aa532661bf6e9a2205a1c6e1e1f3f2171b2b3c8

Contents?: true

Size: 353 Bytes

Versions: 3

Compression:

Stored size: 353 Bytes

Contents

require 'thor'
require_relative 'grid'
class CLI < Thor

  desc "solve [FILE NAME]", "Solves a sudoku puzzle from a text file"
  def solve(file_name)
  	file = File.open(file_name, "rb")
  	contents = file.read.gsub("\n", "")
  	contents.gsub!(" ","")
    grid = Grid.new(contents.scan(/\d{9}/))
    grid.solve
    grid.print_values_formatted
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sudoku-jedi-1.0.1 lib/sudoku_solver/cli.rb
sudoku-jedi-1.0.0 lib/sudoku_solver/cli.rb
sudoku-jedi-0.0.4 lib/sudoku_solver/cli.rb