diff --git a/wordle.sh b/wordle.sh index 9df11c1..2d4c717 100755 --- a/wordle.sh +++ b/wordle.sh @@ -1,7 +1,19 @@ #!/bin/bash -# grep -iEw "n..io" palabras.txt +# fanta +# Helper script to find words in the spanish worlde version +wordList="words-es.txt" + +function showError(){ + echo "[Error] $1" +} + if [ -z "$1" ]; then - echo "Mete el parametro. Ejemplo: wordle.sh n..io . Siendo los puntos lo que desconoces." + showError "Example: wordle.sh n..io (The dots are the unknown characters)" else - grep -iEw "$1" palabras.txt + if [ $(echo -n "$1" | wc -m) -le 5 ]; then + grep -iEw "$1" $wordList + # la salida tendria que ser de palabras solamente con 5 caracteres + else + showError "Too many characters my friend. They must be 5" + fi fi diff --git a/palabras.txt b/words-es.txt similarity index 100% rename from palabras.txt rename to words-es.txt