https://github.com/chantastic/compare-words
A wordle guess-validation functions
https://github.com/chantastic/compare-words
Last synced: about 1 year ago
JSON representation
A wordle guess-validation functions
- Host: GitHub
- URL: https://github.com/chantastic/compare-words
- Owner: chantastic
- License: mit
- Created: 2022-01-15T21:27:42.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-18T18:19:46.000Z (over 4 years ago)
- Last Synced: 2025-03-28T20:36:40.272Z (about 1 year ago)
- Language: JavaScript
- Size: 182 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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/](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
```js
import assess from "compare-words";
assess("begal", "beans");
```
**result**
```js
[
["b", "correct"],
["e", "correct"],
["a", "present"],
["n", "absent"],
["s", "absent"],
];
```
## Install
```bash
npm i compare-words
```
## Resources
- [source](./index.mjs)
- [tests](./test.mjs)
- [implementation nates](./notes.md)
Copyright @ Michael Chan
[Licensed MIT](./LICENSE)