问题描述
我正在为ASCII艺术作品生成脚本。我遇到的问题与用于图像不同阴影的字符有关。我想知道是否有任何资源可以提供有关此信息。
例如,"%"
比"."
占用更多的屏幕空间,因此我将"%"
用于图像的较暗区域,"."
用于较亮的区域。 / p>
解决方法
我使用以下字符集来满足16种不同的灰度强度:
public static boolean areEqualByThreeDecimalPlaces(double a,double b) {
a = Math.round(a * 1000);
b = Math.round(b * 1000);
System.out.println("the first value is" + a);
System.out.println("the second value is" + b);
return a == b;
}
要在HTML页面上显示空格字符,可以使用 pattern:array [0..15] of char = ('#','#','@','%',';','*',','.',' ',' ');