Advertisement
wariat

wordle stat/cheat

Feb 5th, 2022
1,638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.94 KB | None | 0 0
  1. dict.sh:
  2. #!/bin/bash
  3.  
  4. hunspell-unmunch /usr/share/myspell/pl_PL.{dic,aff} \
  5.   2> /dev/null \
  6.   | iconv -f latin2 -t utf8 \
  7.   | grep -E "^.{5}$" \
  8.   | sed -e 's/\(.*\)/\L\1/' \
  9.   | sort -f -u \
  10.   > /tmp/dictionary5.txt
  11.  
  12. wc -l /tmp/dictionary5.txt
  13.  
  14.  
  15. stat.sh:
  16. #!/bin/bash
  17.  
  18. looks="....."
  19. contain=" "
  20. maycontain="a o k r n "
  21. notcontain=" "
  22.  
  23. cmd="cat /tmp/dictionary5.txt | grep $looks"
  24.  
  25. for l in ${contain}
  26. do
  27.   cmd="${cmd} | grep ${l}"
  28. done;
  29.  
  30. for l in ${maycontain}
  31. do
  32.   cmd="${cmd} | grep ${l}"
  33. done;
  34.  
  35. for l in ${notcontain}
  36. do
  37.   cmd="${cmd} | grep -v ${l}"
  38. done;
  39.  
  40. eval ${cmd} > /tmp/words.txt
  41.  
  42. cat /tmp/words.txt | pr -tw80 -5
  43. wc -l /tmp/words.txt
  44. echo
  45.  
  46. if test -f "/tmp/letters.txt";
  47. then
  48.   rm /tmp/letters.txt
  49. fi
  50.  
  51. for l in {a..z} ą ć ę ł ń ó ś ż ź
  52. do
  53.   n=`grep -c "${l}" /tmp/words.txt`
  54.   printf "%05d %s\n" ${n} ${l} >> /tmp/letters.txt
  55. done;
  56.  
  57. cat /tmp/letters.txt | sort -r | pr -tw80 -5
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement