This is gorgeous! You packed in not just a texture but even a scene description! And reflections! However, I have a couple of quibbles:
1. It is not C.
2. It is not 9 lines.
To elaborate on the first point, it's C++, using the functional cast syntax int(C*N), C++ includes, and a non-constant static initializer, none of which are legal in C.
To elaborate on the second point, it's not "9 lines" of C++ in the sense that My Very First Raytracer is "184 lines of C"; it's only 9 lines in the sense that it has two lines of #includes, and then you've chosen to insert six newlines into it at essentially arbitrary locations! Conventionally formatted, it's 45 lines of C++, which seems in keeping with my estimate that the basic raytracing algorithm is about 20 lines of code if you have linear algebra, while having to implement linear algebra adds another bit of code that's slightly larger than 20 lines.
I'm not sure how to define logical lines of code for K, but it seems relevant that one of those 7 lines defines two nested functions.
Here's the reformatted version of your Tinytrace, which I look forward to studying in more detail:
#include <cmath> // sqrt
#include <cstdio> // fopen
int i, p = 0, h[] = { 3 << 16, 8 << 24, 0, 41944064, 8 };
FILE *f = fopen ("o", "wb");
int main() {
fwrite (h, 2, 9, f);
for (; p < 9 << 17;) {
float x = 0,
T = .2,
Y = p % 1024 / 430. - 1,
R = p++ / 327680. - 1,
E = 3,
C = 1 / sqrt (Y * Y + R * R + 1),
I, t, N, A;
Y *= C;
I = 1 | -(Y < 0);
R *= C;
a:
t = x - I;
A = T - I;
N = Y * t + R * A - C * E;
A = N * N - t * t - A * A - E * E + 1;
N += sqrt (A);
if (N < 0) {
E += N * C;
x -= N * Y;
T -= N * R;
t = x - I;
A = T - I;
N = 2 * (Y * t + R * A - C * E);
I = -I;
Y -= N * t;
R -= N * A;
C += N * E;
goto a;
}
fputc (i, f);
if (R < 0) {
N = (3 - T) / R;
i = Y * N;
R *= .4 - (((i + int(C*N)) & 1) + .6);
}
i = R > 1 ? 255 : R * 255;
}
} // "TINY TRACE" edition - JB'22 (but reformatted)
For anyone else who wants to run it, you will probably want to rename the output file "o" to "o.tga", because it's a TARGA-style uncompressed image.