Wednesday, February 27, 2008

Life Code

I was working out in the gym today with a buddy and were were having fun making up some pseudo code for live. It obviously doesn't cover all the variables, but you get the idea.
<%
On Session Start Call LifeCode

SUB LifeCode
dim dbConn, strSQL, rs

Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.open "PROVIDER=SQLOLEDB;DATA SOURCE=YourLife;UID=YourName;PWD=YourName!;DATABASE=YourLife"

strSQL = "SELECT *, SUM(col_Money) as NetWorth from tab_Life GROUP BY col_Money WHERE col_DateToday = "&DATE()&""
set rs = dbConn.Execute(strSQL)

'run below code every day
If Not rs.EOF Then
If rs("NetWorth") > "2000000" then
response.write("Congrats! Stop working and go enjoy yourself!")
Else
If INT(DATE() - rs("col_DateOfBirth")/365) >= 65 then
response.write("Collect Social Security live in a trailer with cats.")
Else
response.write("Get your lazy ass out of bed and go to work.")
End If
End If
Else
response.write("You're Dead")
End If
End Sub
%>

No comments: