8 filename="${1:-example.txt}"
20 buckets=(0 0 0 0 0 0 0 0 0)
25 for (( i=0; i<=8; i++ )); do
26 ((count+=${buckets[$i]}))
32 for f in "${fish[@]}"; do
36 for (( d=1; d<=$iter_2; d++ )); do
37 orig_zeros=${buckets[0]}
38 for (( i=1; i<=8; i++ )); do
40 ((buckets[$((i-1))]+=$temp)) || true
43 ((buckets[8]+=$orig_zeros)) || true
44 ((buckets[6]+=$orig_zeros)) || true
45 ((buckets[0]-=$orig_zeros)) || buckets[0]=0
47 [ $d -eq $iter_1 ] && echo "After $iter_1 days there are $(get_count) fish"
50 echo "After $iter_2 days there are $(get_count) fish"