Fun with VB !!!


Who says you can’t obfuscate VB code?

For fun, I tried writing some VB code which was shaped in the letters ‘vb’ (that’s right, the code itself forms the shape of the letters), where the ‘v’ and the ‘b’ are formed from the Visual Studio inifinity logo. In case you’re having trouble visualizing that, here’s a picture. Because I’m forming the letters from the symbol, the v and b have to be visually interpreted of course:

OK, so we have the above shape, but how to create the code this way? Well, we do that by using the ‘:’ line separator all over the shop in order to allow us to create statements on the same actual physical line as the previous statement. And of course, we need plenty of underscores to format the code as well.

Finally, and importantly, we have to turn off pretty listing so the code retains it’s shape. Make sure if you download the attached file, that you turn pretty-listing off before opening it (or, just look at the txt file, you’ll get the idea).

In the attachment you’ll find the actual file for this, and yes, compile and run at will. To build on the ‘infinity’ concept, I have the code producing the same picture of itself in a winform, a ‘recursive’ concept at least visually.

Naturally, the code is ugly to read, since the point is ont to be readable, but impressive for the effort that goes into it. All coding standards are thrown out the window for the effect: this is one situation where they just don’t apply. And of course, the actual code isn’t colored like it is above, but you’ll find a powerpoint slide in the attachment that has the colored code, in case you want to print it out.

The challenge I put to you now is: what VB code do YOU want to create this way?


Leave a comment

Feedback usabilla icon