Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AsciiArtBenchmark : Object {
- public void benchmark() {
- int x, y, i;
- float a, b, ca, cb, t;
- string c = "0123456789ABCDEF ";
- for (y = -12; y <= 12; y++) {
- for (x = -39; x <= 39; x++) {
- a = ca = x * 0.0458f;
- b = cb = y * 0.08333f;
- for (i = 0; i <= 15; i++) {
- t = (a * a) - (b * b) + ca;
- b = (2 * a * b) + cb;
- a = t;
- if ((a * a + b * b) > 4)
- break;
- }
- stdout.printf("%s", c.substring(i, 1));
- }
- stdout.printf("\n");
- }
- }
- static void main() {
- var test = new AsciiArtBenchmark();
- test.benchmark();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement