~vam-jam/wpath

c0dbbab54246eefc846cdfaa977855fa1d17133b — Vamist 1 year, 6 months ago 7bc0fb7
[dev] Readme
1 files changed, 55 insertions(+), 0 deletions(-)

A README.md
A README.md => README.md +55 -0
@@ 0,0 1,55 @@
# Word Path Calculator
Given two valid words and a dictonary, this application will calculate a word path if possible. 

This should work on Mac, Linux (tested) and Windows.

## Args
To run this program, you are required to pass the following arguments.

```
wpath [file] [starting_word] [ending_word]
```

### File
The file argument expects a file that is readable to the current user encoded in UTF8. 

Most users will want to point this to `/usr/share/dict/words`. If you are on windows, just point it to a similar file or download a copy from https://gist.githubusercontent.com/Warth2033/2a9c38ea200c3499da638c67faff5e9c/raw/d9783627c731268fb2935a731a618aa8e95cf465/words 

### Starting word
This is the word that the program will start off on, this word is required to be alphabetic.

The length of this word must match the ending word.

### Ending word
This is the word that the program will attempt to find a path to. If no path is valid, the program will panic. 

The length of this word must match the starting word. 

## How to compile/run/test
### Install rust
You must install rust for your system, you can do so by reading https://www.rust-lang.org/

### Clone the repo
Either clone with your prefered git client or find a directory and run `git clone https://git.sr.ht/~vam-jam/wpath`

### Compile & run
Once rust is installed, navigate to the folder you just cloned this repo in and run:

`cargo build --release`

This will compile the program with optimizations turned on. Once done, you can either do:

`cargo run --release /usr/share/dict/words cat dog`

Or you can find the executable file here:

`root_folder/target/release/wpath`

And run it with the same args:

`wpath /usr/share/dict/words cat dog`

### Unit testing
Some tests will fail on windows due to hardcoded paths, as long as `/usr/share/dict/words` exists, all tests should pass
`cargo test`