shell脚本画个心

#!/bin/bash
y=1.25
yy=46
while [[ yy -gt 0 ]]; do
xx=-120
x=-1.14
	while [[ 0 -gt xx ]]; do
		cc=$(echo `awk -v a=${
      x} -v b=${
      y} 'BEGIN{printf "%.125f\n",a*a+b*b-1}'`)
		bb=$(echo `awk -v a=${
      cc} -v b=${
      y} -v c=${
      x} 'BEGIN{printf "%.125f\n",a*a*a-c*c*b*b*b}'`)
		ff=$(echo `awk -v a=${
      bb}  'BEGIN{printf "%.0f\n",a*10000000}'`)
		if [[ ff -le 0 ]]; then
			printf "\e[1;41m \e[0m"
		else
		    printf " "
		fi
	x=$(echo `awk -v a=${
      x} -v b=0.02 'BEGIN{printf "%.125f\n",a+b}'`)
	xx=$(echo `awk -v a=${
      xx} -v b=1 'BEGIN{printf "%.0f\n",a+b}'`)
	done
printf "\n"
y=$(echo `awk -v a=${
      y} -v b=0.05 'BEGIN{printf "%.10f\n",a-b}'`)
yy=$(echo `awk -v a=${
      yy} -v b=1 'BEGIN{printf "%.0f\n",a-b}'`)
done

你可能感兴趣的:(centos)