I'd like to think that I'm a pretty passionate programmer, but I don't think I'd describe code as being beautiful. Maybe I've seen one or two nice editor themes that really stand out, but actual code is just a bunch of ASCII characters as far as I'm concerned. At best I'll find myself impressed with a programs organizational structure.
Every now and again though, I'll see a visualization of code that's either really cool or downright breathtaking.
Game of Life
Probably the best known one that I can think of is John Conway's Game of Life. Back in 1970, Conway devised a "game" with 4 simple rules which dictate whether a given cell is on or off based on the on/off state of neighbouring cells. When properly initialized, interesting patterns emerge. You can check out a Java implementation here and a number of videos about all types of implementations on youtube. It's pretty astounding how four simple rules (which are equally simple to implement) can produce something so rich.
Sorting
One of my personal favourites though is the visualization of sorting algorithms. I'm pretty far from an algorithm freak, but there's something just fascinating about watching these go. It isn't so much how they individually look, but rather the diversity of how they operate - which translates in a diverse visual representation. Take a look at this Java applet and hit the "Start All" button in the upper left corner. I find both Bitonic and Heap sorts mesmerizing. And, if you're interested in a more informative version, check this not-so-pretty Java applet, which steps through the Java code for each sorting phase.
Math
It'd be silly not to mention more mathematical-based patterns. Fractals can get pretty crazy, but even the simple Sierpinski Triangle can be hypnotic (maybe it's because I like moving things). There's also Voronoi Diagram and Delaunay Triangulation, which I know nothing about, except that they are much more fun with the "More Colorful" checkbox checked.
Tierra
Although not visually represented, my all time favourite has to be Thomas Ray's Tierra computer simulation. Thomas Ray essentially created evolution within his computer by creating a self replicating code which randomly mutated itself. Out of this seeming chaos emerged parasites, liars and even a more efficient algorithm than the one he himself programmed. The best description, which is absolutely worth the short read, are the first two pages of chapter 15 in Kevin Kelly's most excellent Out Of Control book (and they happen to be freely available - page 1 and page 2).
Terrarium
If you agree with me and find Tierra amazing, you'll probably be interested in Microsoft's Terrarium. This is considerably more complex than everything else we've looked at so far, but it's also the best suited at helping you learn. Terrarium was a learning tool built by Microsoft meant to showcase .NET and help new developers learn the framework and languages. You essentially create an insect by inheriting a base object, and override behaviour - such as what to do when you run into another insect or need to find food. You'd then release your code on a multiplayer server and could see how your insect did compared to everyone else's. I did play with it for a few months years ago, and while the idea was certainly really neat and forward thinking, the implementation was a little weak. Anyways, if you're interested, it looks like the project might be getting resurrected.
Assembly
The last thing I'd like to share are the winners of the annual Assembly contest. Although there are a lot of different categories, the ones that always draw my attention are the file-size limited ones. For example, take last years winner in the 4K winner Candystall by Pittsburgh Stallers vs Loonies. You can watch the video here and download the .exe here. Would you be able to do that in a file under 4k in size? I wouldn't! If you're willing to add a bit more file size, you can also have the world's smallest 3D game engine: kkrieger. At 96k it truly is hard to believe.
Fin
There are countless more, and if you know of anything really neat, please leave a comment. As a final entry, check out Radiohead's House Of Cards video - filmed without a camera.
Source Click Here.
No comments:
Post a Comment
Post your comments here: