Little solver of the NY/Times digits
Small proof-of-concept how NY/Times Digits could be solved programmatically.
TODO
- fix use of duplicate values
- Show operations
- Tests
- Taskfile
- Goreleaser
- Spin
- Comprehensive search to find solution with smallest steps
- Allow to search solutions in reach 10, 25 if no exact match
- Add archive endpoint for previous puzzles
- ...
Usage
go run main.go --target 456 3 13 19 20 23 25
Solving NYDigits
Found solution: 456
Target: 456
Distance: 0
----------------------------------
Operations:
1: 3 + 23 = 26
2: 26 * 19 = 494
3: 494 - 13 = 481
4: 481 - 25 = 456
Compiling from source
If you have Taskfile installed, then you can compile a binary and use the compiled binary to avoid rebuilding it all the time;
task build
./bin/nydigits --target 93 5 7 9 10 15 25
Running Spin
Spin is fantastic project that allows to run and deploy Go applications as serverless applications;
- first build WASM files for each API resource
task spin:build
- start Spin
task spin:up
- run E2E tests
task test:e2e