8 filename="${1:-example.txt}"
17 buckets=(0 0 0 0 0 0 0 0 0)
19 for f in "${fish[@]}"; do
23 for (( d=1; d<=256; d++ )); do
24 orig_zeros=${buckets[0]}
25 for (( i=1; i<=8; i++ )); do
27 ((buckets[$((i-1))]+=$temp)) || true
30 ((buckets[8]+=$orig_zeros)) || true
31 ((buckets[6]+=$orig_zeros)) || true
32 ((buckets[0]-=$orig_zeros)) || buckets[0]=0
36 for (( i=0; i<=8; i++ )); do
37 ((count+=${buckets[$i]}))
40 echo "After 256 days there are $count fish"