3 basedir=$(dirname $(readlink -f ${BASH_SOURCE}))
4 filename="${1:-31_ORE_1_FUEL.txt}"
24 while [ ${#r} -gt 0 ]; do
31 string+=" [$chem]=$count "
33 requires[${p}_${count}]="$string"
34 if [ ${chemicals[$p]} ]; then
35 chemicals[$p]+=" $count"
37 chemicals[$p]="$p_count"
44 while read -u 3 line; do
51 for key in ${!requires[@]}; do
52 echo "$key -> ${requires[$key]}"
57 for key in ${!chemicals[@]}; do
58 echo "$key -> ${chemicals[$key]}"
62 needed=( "${requires[FUEL_1]}" )
64 for key in ${!needed[@]}; do
65 echo "$key ${needed[$key]}"