diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-10-30 15:07:06 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-10-30 15:07:06 +0100 |
| commit | 7c049c043c8921e1b5a40da43dfe708d6b3afc59 (patch) | |
| tree | 5ea7c1475af1173aeb2e9644fc2ba69585fdc52c | |
| parent | 1f4d73381e34b838427ea9a7553891c8de393957 (diff) | |
| download | scripts-7c049c043c8921e1b5a40da43dfe708d6b3afc59.tar.gz scripts-7c049c043c8921e1b5a40da43dfe708d6b3afc59.zip | |
Fixed practice dr filtering
Diffstat (limited to '')
| -rwxr-xr-x | practice | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -54,7 +54,8 @@ dr_scramble() { | |||
| 54 | max="7" | 54 | max="7" |
| 55 | while true; do | 55 | while true; do |
| 56 | eo="$(tr -cd 'UDRL' < /dev/random | fold -w "$d" | head -n 1)" | 56 | eo="$(tr -cd 'UDRL' < /dev/random | fold -w "$d" | head -n 1)" |
| 57 | sol="$(${nissy} solve -p drud-eofb "$eo")" | 57 | eoinv="$(echo "$eo" | rev | sed 's/./&3/g')" |
| 58 | sol="$(${nissy} solve -p drud-eofb "$eoinv")" | ||
| 58 | len="$(echo "$sol" | wc -w)" | 59 | len="$(echo "$sol" | wc -w)" |
| 59 | if [ "$len" -ge "$min" ] && [ "$len" -le "$max" ]; then | 60 | if [ "$len" -ge "$min" ] && [ "$len" -le "$max" ]; then |
| 60 | break | 61 | break |
