Попросил ГПТ нарисовать мне фрактал. На bash. Попросил - получи!
# Set the dimensions of the output
# Set the range of the complex plane
# Function to calculate the Mandelbrot set
for ((j=0; j<HEIGHT; j++)); do
for ((i=0; i<WIDTH; i++)); do
re=$(echo "$RE_MIN + ($RE_MAX - $RE_MIN) * $i / $WIDTH" | bc -l)
im=$(echo "$IM_MIN + ($IM_MAX - $IM_MIN) * $j / $HEIGHT" | bc -l)
while (( $(echo "$z_re * $z_re + $z_im * $z_im <= 4" | bc -l) && iter < max_iter )); do
temp_re=$(echo "$z_re * $z_re - $z_im * $z_im + $re" | bc -l)
z_im=$(echo "2 * $z_re * $z_im + $im" | bc -l)
if (( iter == max_iter )); then
# Run the Mandelbrot function