0.0.1 • Published 2 years ago

compare-words v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Word Match

compare-words is a small utility for assessing how much one word matches another.

It's inspired by https://www.powerlanguage.co.uk/wordle/.

Overview

  • Takes two words of any size
  • The second is compared to the first
  • Compares words for precise and non-precise letter matches
  • Returns an array of tuples revealing the second word letters and their precision against the first

Example

import assess from "compare-words";

assess("begal", "beans");

result

[
  ["b", "correct"],
  ["e", "correct"],
  ["a", "present"],
  ["n", "absent"],
  ["s", "absent"],
];

Resources

Copyright @ Michael Chan Licensed MIT