Exodus - Restart

Apr 24, 2005 06:22

Yes. I have finally gotten around to restarting the project. Unfortunately, it isn't even remotely playable now. I'm adding a bunch of stuff that the old 'version' didn't have - in the way of 'checking' procedures and such. I'll work out the mathematics for an entirely different combat system within the next couple of days and all should be good.

I might even make Exodus an open-source project at some point. For those of you who have no idea what 'open-source' is, I say you need an update on your computer terminology. Open-source simply means that anyone can download, use, or modify the Exodus source code for whatever reasons - provided it is within the guidlines set by the GNU Public License. Of course, being the good boy that I am, I will release the source with the license, just so there's no mistake about it all. :)

I don't really think I have much more to say. I do, however, think I'll get rid of some useless procedures I threw into the new Exodus system simply to fill it out a little. I don't have any clue why I added these:

#define FALSE 0
#define TRUE 1

proc
 /*
  FalseStatement(test)
  Args: test - may be any variable type.
  Returns:
  If the test variable is TRUE, it will return
  FALSE, if it is FALSE it will return TRUE.
 */
 FalseStatement(test)
  if (test) return FALSE
  else return TRUE

/*
  TrueStatement(test)
  Args: test - may be any variable type.
  Returns:
  If the test variable is TRUE, it will return
  TRUE, if it is FALSE it will return FALSE.
 */
 TrueStatement(test)
  if (test) return TRUE
  else return FALSE

This, of course, can all be handled quite simply with the ! operator. It completely baffles me as to why, in all things holy, I added these. I mean. C'mon?

if (TrueStatement(myvar)) // True
and
if (FalseStatement(myvar)) // False
versus
if (myvar) // True
and
if (!myvar) // False

Which of these do you think looks like more efficient code? Considering that the TrueStatement() and FalseStatement() procs have to run their own code anyway, its quite obvious that the latter - using the ! operator - is much more efficient.

I should slap myself one day.

-- Tristan
Previous post Next post
Up