aboutsummaryrefslogtreecommitdiff
path: root/games/hku
blob: 029b41c63df7fc5b839f48d80ca6c2ee080a9a4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
hash syl || exit
declare -a lsts ws
lsts=(5 7 5)
for ((lc=0;lc<${#lsts[@]};lc++)) ; do
    ws=()
    for ((sc=0;sc<lsts[lc];)) ; do
        read -r wr
        sy=$(syl "$wr")
        ((sy<=lsts[lc]-sc)) || continue
        ws[${#ws[@]}]=$wr
        ((sc+=sy))
    done
    printf '%s\n' "${ws[*]}"
done < <(shuf /usr/share/dict/words |
    grep -v \'s\$)