~vam-jam/wpath

Word path problem solved in rust (exercise)
[fix] Spelling mistakes
[dev] Readme
[dev] Unit tests

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~vam-jam/wpath
read/write
git@git.sr.ht:~vam-jam/wpath

You can also use your local clone with git send-email.

#Word Path Calculator

Given two valid words and a dictionary, 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 preferred 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