3 ms·
Yes I just noticed that issue too, still trying to figure out how to fix it :P
by huydotnet 5y ago
Yes I just noticed that issue too, still trying to figure out how to fix it :P
- indigodaddy 5y agoPlease let us know when that is fixed and I’ll play this for sure!
- kccqzy 5y agoIf you don't mind a shameless plug, I made this same mistake before and here's how I fixed it: https://github.com/kccqzy/Wordle-Assistant/blob/27d208248b7a1cc63de2773b072bcfa42266e7bc/src/main.rs#L220-L257 https://github.com/kccqzy/Wordle-Assistant/blob/27d208248b7a...
- hddqsb 5y agoHere is one way to fix it (but it will push you over 50 lines!) remaining="" output="" for ((i = 0; i < ${#actual}; i++)); do if [[ "${actual:$i:1}" != "${guess:$i:1}" ]]; then remaining+=${actual:$i:1} fi done for ((i = 0; i < ${#actual}; i++)); do if [[ "${actual:$i:1}" != "${guess:$i:1}" ]]; then if [[ "$remaining" == *"${guess:$i:1}"* ]]; then output+="\033[30;103m ${guess:$i:1} \033[0m" remaining=${remaining/"${guess:$i:1}"/} else output+="\033[30;107m ${guess:$i:1} \033[0m" fi else output+="\033[30;102m ${guess:$i:1} \033[0m" fi done printf "$output\n" Explanation: The variable `remaining` tracks the letters of `actual` that can contribute toward yellows.
- huydotnet 5y agoI think I just fixed the problem now. And it's still 50 lines :D
- rrmm 5y agoHere's my straight javascript version https://github.com/rrmm/mastermind-word https://github.com/rrmm/mastermind-word . But it isn't particularly source length efficient.