이것은 가능한 가장 적은 수의 단계에서 숫자 퍼즐을 풀기위한 간단한 대기열 기반 접근법입니다.
python solver.py 1 2 3 4 10 25 --target 81
(여기서 6 개의 숫자는 6 개의 숫자가 점선에 요약되어 있고 81은 당신이 도달하려는 큰 숫자입니다) $ python3 solver.py 5 11 19 20 23 25 -t 413
Found a solution in 4 steps. Run with --spoil to see the details.
$ python3 solver.py 5 11 19 20 23 25 -t 413 --spoil
Found a solution in 4 steps:
20 ➖ 11 ? 9
23 ➕ 25 ? 48
9 ✖️ 48 ? 432
432 ➖ 19 ? 413
test_solver.py
에 최소한의 테스트가 있습니다. python -m unittest
실행하여 변경 후 작업이 작동하는지 확인하십시오.
Mastodon : https://takahe.social/@drew에서 나를 찾으십시오
PRS 환영합니다!