Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/p1atdev/wordle-solver
Wordle Solver with Deno
https://github.com/p1atdev/wordle-solver
deno puppeteer wordle
Last synced: 6 days ago
JSON representation
Wordle Solver with Deno
- Host: GitHub
- URL: https://github.com/p1atdev/wordle-solver
- Owner: p1atdev
- Created: 2022-02-16T15:07:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-20T13:49:31.000Z (almost 3 years ago)
- Last Synced: 2024-12-17T02:32:24.454Z (20 days ago)
- Topics: deno, puppeteer, wordle
- Language: TypeScript
- Homepage: https://deno.land/x/wordle_solver
- Size: 314 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wordle Solver with Deno
A wordle solver with Deno.
![](./wordle.png)
# How to use
Example codes are available in `/examples`!## Basic usage
```ts
// example.tsimport { getAnswer, getGameNumber } from "./wordle.ts"
const answer = getAnswer()
const gameNumber = getGameNumber()console.log(`Wordle ${gameNumber}`)
console.log(`Today's wordle answer is "${answer}"!`)```
Run `example.ts` as follows
```bash
deno run example.ts
```The result is
```
Wordle 247
Today's wordle answer is "other"!
```## Predicting future answers
I wrote "prediction", but it is almost certainly true.```ts
// predict.tsimport { getAnswer, getGameNumber } from "../wordle.ts"
const targetDate = new Date(2022, 4, 1, 0, 0, 0, 0)
const answer = getAnswer(targetDate)
const gameNumber = getGameNumber(targetDate)console.log(`Wordle ${gameNumber}`)
console.log(`Wordle answer on 4/1/2022 is "${answer}"!`)```
The result is
```
Wordle 316
Wordle answer on 4/1/2022 is "trash"!
```# How it works
In the main.hoge.js file of Wordle, the list of all answers is hard-coded, and the index of the game answer is equal to the difference between a particular date and today's date.
If wordle changes its specification and generates answers in a different way than it does now, this will stop working, but the list of answers is about six years long, so you may not need to worry about it for the time being.