Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // original BASIC code at https://www.retrobrewcomputers.org/forum/index.php?t=msg&th=201&goto=4704&#msg_4704
- // translated C code, CC0
- #include <stdio.h>
- int main(int argc, char *argv[])
- {
- int x, y, i;
- float a, b, ca, cb, t;
- const static unsigned char c[] = "0123456789ABCDEF ";
- for (y = -12; y <= 12; y++) {
- for (x = -39; x <= 39; x++) {
- a = ca = x * 0.0458;
- b = cb = y * 0.08333;
- 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;
- }
- putchar(c[i]);
- }
- putchar('\n');
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment