<commit_before>= Knight's Tour

A program that attempts to find a solution to the
{Knight's Tour problem}[http://en.wikipedia.org/wiki/Knight%27s_Tour].
I was inspired to do this by finding
{a Python implementation}[http://ttsiodras.googlepages.com/knightstour.html].

The program's algorithm is a recursive backtracking search that returns the
first solution to the problem (if the algorithm finds one). It utilizes
{Warnsdorff's heuristics}[http://mathworld.wolfram.com/KnightsTour.html] to
avoid dead ends, making the search faster in general.

== Installation

Install the software as a RubyGem from GitHub:

  $ sudo gem install tuomas-knights_tour --source http://gems.github.com

The software is compatible with Ruby 1.9.1.

== Usage

Change the working directory of your command line shell into the project's
root directory and enter

  $ ./bin/knights_tour

The command attempts to solve the problem on a board of size 8x8, the knight
located initially at position 0,0 (the top-left corner). If the program
finds a solution, it displays a result similar to the following:

  +---+---+---+---+---+---+---+---+
  |  1| 62| 13| 36|  3| 38| 31| 28|
  +---+---+---+---+---+---+---+---+
  | 14| 35|  2| 63| 32| 29|  4| 39|
  +---+---+---+---+---+---+---+---+
  | 61| 12| 59| 34| 37| 42| 27| 30|
  +---+---+---+---+---+---+---+---+
  | 50| 15| 64| 43| 58| 33| 40|  5|
  +---+---+---+---+---+---+---+---+
  | 11| 60| 49| 54| 41| 24| 45| 26|
  +---+---+---+---+---+---+---+---+
  | 16| 51| 18| 57| 44| 55|  6| 23|
  +---+---+---+---+---+---+---+---+
  | 19| 10| 53| 48| 21|  8| 25| 46|
  +---+---+---+---+---+---+---+---+
  | 52| 17| 20|  9| 56| 47| 22|  7|
  +---+---+---+---+---+---+---+---+

The size of the board and the start position of the knight are configurable.
For all the options, see

  $ ./bin/knights_tour -h

== Contacting

Please send feedback by email to <NAME> < tkareine (at) gmail (dot)
com >.

== Legal notes

This software is licensed under the terms of the "MIT license":

Copyright (c) 2008-2009 <NAME>.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
<commit_msg>Forgot to fix usage documentation.<commit_after>= Knight's Tour

A program that attempts to find a solution to the
{Knight's Tour problem}[http://en.wikipedia.org/wiki/Knight%27s_Tour].
I was inspired to do this by finding
{a Python implementation}[http://ttsiodras.googlepages.com/knightstour.html].

The program's algorithm is a recursive backtracking search that returns the
first solution to the problem (if the algorithm finds one). It utilizes
{Warnsdorff's heuristics}[http://mathworld.wolfram.com/KnightsTour.html] to
avoid dead ends, making the search faster in general.

== Installation

Install the software as a RubyGem from GitHub:

  $ sudo gem install tuomas-knights_tour --source http://gems.github.com

The software is compatible with Ruby 1.9.1.

== Usage

Enter

  $ knights_tour

The command attempts to solve the problem on a board of size 8x8, the knight
located initially at position 0,0 (the top-left corner). If the program
finds a solution, it displays a result similar to the following:

  +---+---+---+---+---+---+---+---+
  |  1| 62| 13| 36|  3| 38| 31| 28|
  +---+---+---+---+---+---+---+---+
  | 14| 35|  2| 63| 32| 29|  4| 39|
  +---+---+---+---+---+---+---+---+
  | 61| 12| 59| 34| 37| 42| 27| 30|
  +---+---+---+---+---+---+---+---+
  | 50| 15| 64| 43| 58| 33| 40|  5|
  +---+---+---+---+---+---+---+---+
  | 11| 60| 49| 54| 41| 24| 45| 26|
  +---+---+---+---+---+---+---+---+
  | 16| 51| 18| 57| 44| 55|  6| 23|
  +---+---+---+---+---+---+---+---+
  | 19| 10| 53| 48| 21|  8| 25| 46|
  +---+---+---+---+---+---+---+---+
  | 52| 17| 20|  9| 56| 47| 22|  7|
  +---+---+---+---+---+---+---+---+

The size of the board and the start position of the knight are configurable,
however. For all the options, see

  $ knights_tour -h

== Contacting

Please send feedback by email to T<NAME> < tkareine (at) gmail (dot)
com >.

== Legal notes

This software is licensed under the terms of the "MIT license":

Copyright (c) 2008-2009 <NAME>.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

{'fraction_non_alphanumeric': 0.20246153846153847, 'fraction_numerical': 0.055794871794871796, 'mean_word_length': 2.6442451420029895, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1911014', 'n_tokens_mistral': 1943, 'n_tokens_neox': 1635, 'n_words': 630}