4 ms·
I have to say I'm a huge fan of these "X in 100 lines of C++" adventures. They're a great starting point for people like me wanting to learn about a subject in
by dtf 16y ago
I have to say I'm a huge fan of these "X in 100 lines of C++" adventures. They're a great starting point for people like me wanting to learn about a subject in a programmatic way.
This global illumination ray-tracer was posted a while back: http://kevinbeason.com/smallpt/ http://kevinbeason.com/smallpt/
- silentbicycle 16y agoHere's one of the most interesting "X in Y lines of Z" programs I've seen, a prototype interpreter for the basics of an APL-like language in one page of (rather funky, Arthur Whitney-style) C: http://nsl.com/papers/origins.htm http://nsl.com/papers/origins.htm It segfaults due to nonportable assumptions about pointer sizes in the allocator, and is far from complete as APLs go, but I spent a couple hours picking it apart and came away quite impressed. There's a similar raytracer (http://nsl.com/k/ray/rayq.k http://nsl.com/k/ray/rayq.k) in 17 lines of Q, but I haven't figured that one out yet.
- hxa7241 16y ago. . . or MiniLight: http://www.hxa.name/minilight/ http://www.hxa.name/minilight/ is an alternative: it is larger -- averaging 650 lines -- but it is available in 9 different languages -- and is a more complete renderer that you can put your own scenes into. (I am working on the Scheme translation at the moment)