https://gitlab.com/christosangel/wordle-solver
If you prefer using just one line in terminal:
Code: Select all
FGE1="grep -E \"^.....$\"";for try in {1..6};do F1="$FGE1""$FGVE1""$CR1""$MSPL1""$AB1";db="c";while [[ $db = "c" ]];do w=$(look .| eval $F1|grep -v "'"|shuf|head -1);echo "Enter word: "\"$w\";read -p "Or press c for another word:" db;done; for i in {0..4};do GE1[$i]="";for ii in {0..4};do if [ $ii -eq $i ];then X="${w:i:1}";else X=".";fi;GE1[$i]=${GE1[$i]}"$X";done;echo -e "${w:i:1} is \n 1.Correct \n 2.Misplaced\n 3.Absent\n 4.Quit ";read -p "Select : " l[$i];case ${l[$i]} in 1) CR+=("${w:i:1}");WORD[$i]=${w:i:1};GE1[$i]="grep -E \"${GE1[$i]}\"";FGE1+=\|${GE1[$i]};;2) MSPL+=("${w:i:1}");GVE1[$i]="grep -vE \"${GE1[$i]}\"";FGVE1+=\|${GVE1[$i]};;3) AB+=("${w:i:1}");;4)exit;;esac;done;for c in "${CR[@]}";do CR1=$CR1"|grep "$c;done;for m in "${MSPL[@]}";do MSPL1=$MSPL1"|grep "$m;done;for a in "${AB[@]}";do AB1=$AB1"|grep -v "$a;done;done