/* turtle.c (comment4.c) - Don Yang (uguu.org) Program writes directly to video memory. If you don't run it in color text mode (3: 80x25x16) with black background, it will not work. DOS only! Compile with Microsoft C 6.0 or Borland Turbo C 3.0. 08/27/98: main */ #include /* Display routine */ #define draw(a, c) screen[a + 657] = colors[c] int _far *screen = (int _far *)0xb8000000; int colors[16] = {0, 0x8df, 0x7df, 0xfdf, 0x8dc, 0x8db, 0x78dc, 0x7fdf, 0x7dc, 0x78df, 0x7db, 0x7fdf, 0xfdc, 0x7fdc, 0x7fdc, 0xfdb}; /* Overlapping run length encoding of image */ int script[] = { 2,-214, 67,-205, -6, -61, -28, -2, -1, 17, 71, 3, 169, -3, 199, 206, 287, 9, 319, 6, 333, 19, 340, 3, 416, 1, 485, 17, 501, -2, 523, 549, 4, 577, -3, 595, 654, 736, 20, 740, 18, 790, 1, 815, 9, 825, 15, 871, 1, 923, 7, 977, 3, 999, 0, 1,-215, 66,-204, 60,-121, 1, -7, 10, 7, -2, 50, 120, 6, 123, 1, 171, 21, 178, 1, 205, 3, 392, 7, 400, 3, 482, 12, 583, 1, 653, 8, 658, 1, 681, 25, 684, 1, 728, 4, 828, 1, 884, 7, 916, 1, 982, 0, 64,-203, 1, -78, 15, -76, 1, 128, 4, 335, 1, 393, 11, 584, 1, 652, 18, 741, 12, 872, 4, 978, 0, 14,-136, 28,-106, 1, -41, 5, 1, 1, 40, 9, 159, -3, 174, 175, 203, 21, 289, 24, 367, 2, 397, 26, 445, 7, 473, 1, 495, 25, 604, 1, 665, 9, 672, 5, 731, 3, 761, 1, 822, 7, 837, 8, 887, 23, 953, 1, 997, 0, -2, 150, 237, 9, 239, 4, 360, 1, 438, 4, 440, 1, 628, 22, 630, -2, 708, 843, 25, 845, 0, 11, -39, 8, 42, -5, 157, 317, 327, 443, 470, 3, 497, 1, 602, 18, 710, 1, 904, 0, 0, 18, -59, 3, 2, 21, 19, 5, 73, -4, 201, 202, 414, 479, 8, 487, 25, 551, 1, 580, 4, 598, 1, 664, 7, 674, 4, 732, 6, 809, 5, 817, 5, 838, 1, 869, 7, 907, 1, 952, 13, 963, 12, 985, 419,1004, 0, 46,-185, 7, 80, 5, 152, -7, 167, 283, 286, 338, 499, 575, 788, 27, 925, 0, -5, 247, 250, 278, 358, 363, 24, 525, 23, 765, 0, 75,-290, 17,-202, 1,-140, 13,-120, 6, -84, 13, -75, -2, -29, -8, 9, 8, 7, 89, 4, 124, 20, 179, 18, 260, 5, 312, 1, 406, 17, 421, -2, 517, 548, 9, 585, -3, 650, 651, 680, 16, 742, 1, 806, 10, 873, 1, 894, 6, 917, 2, 979, 0, 12,-135, 2, 3, 5, 474, 13, 562, 1, 663, 3, 733, -2, 762, 820, 4, 839, -2, 913, 951, 11, 964, 1,1057, 361,1062, 0, 0, 10,-134, 17, -58, 18, -26, 20, 20, 18, 53, 4, 74, 1, 86, 22, 98, 18, 132, 1, 202, 19, 211, 5, 232, 1, 257, 20, 290, 22, 368, 5, 409, 24, 446, 4, 475, 7, 488, 3, 520, 10, 552, 10, 565, 3, 599, 1, 662, 5, 675, 2, 734, 8, 748, 1, 819, 3, 840, 6, 888, 5, 908, 1, 950, 10, 965, 10, 986, 1,1056, 360,1063, 0, 287,-577, 70,-287, 15,-201, 44,-184, 5,-131, 12,-119, 21,-105, 3, -83, 11, -73, 15, -57, 9, -38, 17, -25, 7, 9, 18, 21, 7, 43, 17, 54, 2, 75, 5, 81, 3, 90, 21, 99, 2, 125, 17, 133, 4, 153, 7, 160, 1, 170, 19, 180, 18, 212, 4, 233, 7, 240, 4, 253, 17, 261, 2, 281, 19, 291, 3, 313, 7, 320, 2, 336, 17, 341, 2, 361, 21, 369, 5, 401, 2, 417, 16, 422, 2, 441, 23, 447, 3, 476, 6, 489, 1, 498, 15, 502, 2, 521, 22, 526, 8, 553, 8, 567, 2, 578, 4, 587, 2, 600, 23, 605, 19, 631, 3, 659, 3, 677, 23, 685, 17, 711, 4, 744, 6, 750, 22, 766, 15, 791, 5, 810, -3, 818, 841, 842, 23, 846, 5, 889, 7, 897, 5, 918, 24, 926, 8, 967, 8, 987, 51,1005, 13,1065, 340,1083, 0}; /* Image decoder */ void main(void) { int i = 0, p, c = 1; for(p = 0; p < 25; p++) printf("\n"); while( c < 16 ) { if( script[i] ) { if( script[i] < 0 ) { for(p = -script[i++]; p; p--) draw(script[i++], c); i--; } else { p = script[i++]; while( p ) draw(--p + script[i], c); } } else { c++; } i++; } }