Wednesday, February 28, 2007

Madness

OK, I’m now a living proof that a person can go mad from looking at too much code. As I was taking my smoke break, I got this idea – what if I took a book, a regular book, and rewrote it in Visual Basic? Then I decided that rewriting a book might be too ambitious of a project, so I decided to start small and rewrite “Twinkle, twinkle little star” in VB.NET. Here it is:



Public Class Song

Sub Song_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Star as New Star
Dim Myself as New Myself

'**************************************************
‘First twinkle
‘**************************************************

Star.Twinkle = 1 ‘on
Star.Twinkle = 0 ‘off


‘**************************************************
‘Second twinkle
‘**************************************************

Star.Twinkle = 1 ‘on
Star.Twinkle = 0 ‘off

‘**************************************************
'Little star
‘**************************************************

Star.Size = “little”

‘**************************************************
‘How I wonder
‘**************************************************

Myself.wonder = True

‘**************************************************
‘What you are
‘**************************************************

Response.Write Star.Shape()
Response.Write Star.Size()
Response.Write Star.DistanceFromEarth()
Response.Write Star.Classification()
End Sub

End Class

No comments: