There are some peculiar developers out there who love writing obfuscated code ” in other words, programs where it's almost impossible to work out what the code is doing. Although there are regular language competitions that give prizes for writing obfuscated programs, Visual Basic has never been an obvious candidate for this kind of treatment. With no peculiar syntax or fancy programming constructs, it seems to be the ugly stepsister when placed alongside its more complicated and confusing language cousins. So I thought I would address this sad state of affairs by writing an obfuscated VB .NET program. See if you can work out what this console application produces without actually running it:
Option Strict On Module Obfuscation Sub Main() Dim x As Integer, x1 As String, x2 As String For x = 0 To 5 x1 = x1 & Chr(CInt(x * (x * (x * (x * (-0.75 * x + 7.2917) - 22.5) _ + 16.708) + 28.25) + 72)) Next x For x = 0 To 6 x2 = x2 & Chr(CInt(x * (x * (x * (x * (x * (0.425 * x - 6.8667) _ + 40.833) - 109.58) _+ 122.24) - 23.05) + 87)) Next x Console.WriteLine(x1 & x2) Console.ReadLine() End Sub End Module