Compare commits
3
Commits
a827bd5eef
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1f14a5bba
|
||
|
|
0cad77fb39
|
||
|
|
14e22db8ec
|
@@ -0,0 +1,60 @@
|
|||||||
|
# Wordle Solver
|
||||||
|
|
||||||
|
This wordle solver uses an information theory based approach to evaluate the next-best-guess. It's heavily inspired by [3b1b's approach](https://www.youtube.com/watch?v=v68zYyaEmEA) on solving wordle.
|
||||||
|
|
||||||
|
There are two ways to use the wordle-solver.
|
||||||
|
|
||||||
|
1. a CLI tool
|
||||||
|
2. a web interface
|
||||||
|
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
|
||||||
|
#### CLI
|
||||||
|
```sh
|
||||||
|
docker run --rm -it git.jroeger.de/jonas/wordle-solver-rs
|
||||||
|
```
|
||||||
|
|
||||||
|
#### web
|
||||||
|
``` sh
|
||||||
|
docker run -p 8080:80 --rm -it git.jroeger.de/jonas/wordle-solver-rs-web
|
||||||
|
```
|
||||||
|
|
||||||
|
# Nix
|
||||||
|
|
||||||
|
#### CLI
|
||||||
|
|
||||||
|
``` sh
|
||||||
|
nix run .
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Static web site
|
||||||
|
|
||||||
|
``` sh
|
||||||
|
nix build git+http://git.jroeger.de/jonas/wordle-solver-rs#wordle-solver-web
|
||||||
|
```
|
||||||
|
|
||||||
|
# Native
|
||||||
|
|
||||||
|
#### CLI
|
||||||
|
|
||||||
|
you will need to have `cargo` installed.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo run --profile release
|
||||||
|
```
|
||||||
|
|
||||||
|
#### web
|
||||||
|
|
||||||
|
you need the following tools:
|
||||||
|
- `wasm-pack`
|
||||||
|
- `wasm-bindgen`
|
||||||
|
- `cargo`
|
||||||
|
- `nodejs`
|
||||||
|
- `yarn`
|
||||||
|
|
||||||
|
``` sh
|
||||||
|
cd web
|
||||||
|
yarn install
|
||||||
|
yarn serve # or yarn build
|
||||||
|
```
|
||||||
@@ -6,7 +6,6 @@ let
|
|||||||
nginx,
|
nginx,
|
||||||
runCommand,
|
runCommand,
|
||||||
wordle-solver-web,
|
wordle-solver-web,
|
||||||
writeShellScriptBin,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
dockerTools.buildImage {
|
dockerTools.buildImage {
|
||||||
@@ -21,10 +20,6 @@ let
|
|||||||
"nogroup:x:65534:"
|
"nogroup:x:65534:"
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
(writeShellScriptBin "start" ''
|
|
||||||
echo "Start serving worlde-solver at port 80..."
|
|
||||||
/bin/nginx -c /etc/nginx.conf
|
|
||||||
'')
|
|
||||||
(runCommand "nginx-conf" {} ''
|
(runCommand "nginx-conf" {} ''
|
||||||
mkdir -p $out/etc
|
mkdir -p $out/etc
|
||||||
|
|
||||||
@@ -47,13 +42,13 @@ let
|
|||||||
EOF
|
EOF
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
pathsToLink = ["/bin" "/etc"];
|
pathsToLink = ["/etc"];
|
||||||
};
|
};
|
||||||
runAsRoot = ''
|
runAsRoot = ''
|
||||||
mkdir -p /var/log/nginx
|
mkdir -p /var/log/nginx
|
||||||
'';
|
'';
|
||||||
config = {
|
config = {
|
||||||
Cmd = ["/bin/start"];
|
Cmd = ["${nginx}/bin/nginx" "-c" "/etc/nginx.conf"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|||||||
+2
-1
@@ -4,13 +4,14 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"serve": "run-s wasm-pack:release vite:serve",
|
||||||
"build-no-wasm": "run-s tsc vite:build",
|
"build-no-wasm": "run-s tsc vite:build",
|
||||||
"build": "run-s wasm-pack:release tsc vite:build",
|
"build": "run-s wasm-pack:release tsc vite:build",
|
||||||
"dev": "run-s wasm-pack:dev vite:dev",
|
"dev": "run-s wasm-pack:dev vite:dev",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"vite:build": "vite build",
|
"vite:build": "vite build",
|
||||||
"vite:dev": "vite -c vite.config.dev.ts",
|
"vite:dev": "vite -c vite.config.dev.ts",
|
||||||
"vite:preview": "vite preview",
|
"vite:serve": "vite -c vite.config.ts",
|
||||||
"wasm-pack:dev": "rm -rf pkg; wasm-pack build --dev --features wasm-bindgen --manifest-path ../Cargo.toml; mv ../pkg .",
|
"wasm-pack:dev": "rm -rf pkg; wasm-pack build --dev --features wasm-bindgen --manifest-path ../Cargo.toml; mv ../pkg .",
|
||||||
"wasm-pack:release": "rm -rf pkg; wasm-pack build --features wasm-bindgen --manifest-path ../Cargo.toml; mv ../pkg ."
|
"wasm-pack:release": "rm -rf pkg; wasm-pack build --features wasm-bindgen --manifest-path ../Cargo.toml; mv ../pkg ."
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user