An open API service indexing awesome lists of open source software.

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

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)