Game Programming and Development Tools

Abstract Coding Instances – Mene-Mene

Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
What are some of the weirdest, and wackyest variables, type instances, functions, and ext. I doesn't have to be funny to all, just was to be odd, or funny.

My most recent was, "SCorellian.Planets[0].Zones[0].Spawns[0] = "Battle Droid"" The funniest thing is I wasn't trying for length or anything, just naturally came up that way. lol.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto
I reserve the full right to change my views/theories at any time.

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
I wrote a fairly convoluted "for" loop the other day. Here it is (variable names have been changed to protect the innocent):

for( ABC_Class * pvar = &others[_i]; pvar; ++_i < nOthers ? pvar = &others[_i] : pvar = NULL )

This is only part of a macro I wrote, that I use quite a bit.

------------------
+---------+
|steveth45|
+---------+

Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
lol.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto
I reserve the full right to change my views/theories at any time.

MastaLlama

Member

Posts: 671
From: Houston, TX USA
Registered: 08-10-2005
Code below in ASP/VBScript, I wouldn't really run this, cuz it would be *too* funny!


Funny = 1
Do While Funny = 1
If Funny = 1 Then
Response.Write "This loop is funny!<br>" & VbCrLf
Else
Exit Do
End If
Loop

[This message has been edited by mastallama (edited July 31, 2007).]

Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
what did you use it for?

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto
I reserve the full right to change my views/theories at any time.

MastaLlama

Member

Posts: 671
From: Houston, TX USA
Registered: 08-10-2005
I didn't. It would not be good for the web server if it ran. What's funny about it is it's a loop with 2 ways out...but it never stops!!!!
Matt Langley
Member

Posts: 247
From: Eugene, OR, USA
Registered: 08-31-2006
This is a comment burried in the bowels of the Torque Game Engine (the 3D one thats been around forever)


// For truly it is written: "The wise man extends GameBase for his purposes,
// while the fool has the ability to eject shell casings from the belly of his
// dragon." -- KillerBunny

------------------
Matthew Langley
Lead Documentation Engineer
GarageGames

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
haha... I love when your going through some code and find the weirdest comments...

------------------
jonwarner.net

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
Google code search is good for those sorts of things. I found this:

warn "Fashion tragedy" if @_ and $_[0] eq 'Plaid';

------------------
+---------+
|steveth45|
+---------+

MastaLlama

Member

Posts: 671
From: Houston, TX USA
Registered: 08-10-2005
Microsoft Exchange has what's called Outlook Web Access. It's mostly a compiled DLL file that talks to the Exchange server data store but there are a few javascript files too. All of their javascript files skip the first 76 lines and actually start the code on line 77. I'm not sure what this is about...maybe Microsoft thinks "if someone opens our .js file they'll think it's empty!" ...but that's pretty stupid.

Also, inside the util_buttons.js file there's the following comment:


// Total hack here because the newmenu button is so wierd
// this code relies on this button being the first one in the toolbar
// it is wierd becasue we align the dropdown with the new msg icon and the little
// drop down arrow. this is NOT the norm for a dropdown menu in the toolbar

Sounds like a high school girl left the comment...LOL

MastaLlama

Member

Posts: 671
From: Houston, TX USA
Registered: 08-10-2005
Ok, here's a function I *HAD* to write today. I'm integrating Microsoft Exchange and our custom build CRM (Customer Relationship Management) system. The system will sync our CRM Events with Exchange/Outlook's Appointments. But, since Exchange is mean and ugly to work with if you're not employeed by Microsoft I'm having to jump through hoops to get this to work. Soooo...the only way I can modify or delete an Appointment is to compare it's "creation date" (which I save in our CRM when the Appointment is created). This isn't sooo bad except Exchange will not CAST the date saved in the CRM database to the correct formatted "dateTime" in Exchange's database store. Sooo...I wrote this function. (Code is in ASP/VBScript)


Function DateCompare(d1,d2)
DateCompare = 0
If Year(d1) = Year(d2) Then
If Month(d1) = Month(d2) Then
If Day(d1) = Day(d2) Then
If Hour(d1) = Hour(d2) Then
If Minute(d1) = Minute(d2) Then
If Second(d1) = Second(d2) Then
DateCompare = 1
End If
End If
End If
End If
End If
End If
End Function

Crazy...stupid...but works.

EDIT: After looking at my function I thought "duh...I can make that more efficient."


Function DateCompare(d1,d2)
DateCompare = 0
If Year(d1) = Year(d2) AND Month(d1) = Month(d2) AND Day(d1) = Day(d2) AND Hour(d1) = Hour(d2) AND Minute(d1) = Minute(d2) AND Second(d1) = Second(d2) Then
DateCompare = 1
End If
End Function

So that makes my original post all the more "abstract"...hee hee

[This message has been edited by mastallama (edited August 03, 2007).]