Friday, August 17, 2007

Original ADVENT Source Code Found!

Too cool not to blog about....

This guy has analyzed the original source code to Adventure. Notable in that sentence is that he actually has found the source code to Adventure, in a backup of Don Woods' account. This is a phenomenally important piece of code, and I think it's incredible that it's managed to survive into an age where it can be preserved.

Looking at it a bit, it's funny to think just how unlike the game itself this code is. Today, you can at least read many parts of code and see the game itself in the source. Whereas some game code to pick up an item may look like:

int Player::itemCollision(Item item)
{
if(Player.myInventory.isFull())
{
Alert("You can't carry any more items!");
return -1;
}
Player.myInventory.append(item);
}


The Adventure 0 code (in Fortran-IV!) to "CARRY" something is:

C CARRY

9000 IF(JOBJ.EQ.18)GOTO 2009
IF(IPLACE(JOBJ).NE.J) GOTO 5200
9001 IF(IFIXED(JOBJ).EQ.0)GOTO 9002
CALL SPEAK(25)
GOTO 2011
9002 IF(JOBJ.NE.BIRD)GOTO 9004
IF(IPLACE(ROD).NE.-1)GOTO 9003
CALL SPEAK(26)
GOTO 2011
9003 IF((IPLACE(4).EQ.-1).OR.(IPLACE(4).EQ.J)) GOTO 9004
CALL SPEAK(27)
GOTO 2011
9004 IPLACE(JOBJ)=-1
9005 IF(IOBJ(J).NE.JOBJ) GOTO 9006
IOBJ(J)=ICHAIN(JOBJ)
GOTO 2009
9006 ITEMP=IOBJ(J)
9007 IF(ICHAIN(ITEMP).EQ.(JOBJ)) GOTO 9008
ITEMP=ICHAIN(ITEMP)
GOTO 9007
9008 ICHAIN(ITEMP)=ICHAIN(JOBJ)
GOTO 2009


My, my, how far code has come. Anyway, if you're interested, I recommend at least thumbing through the source. It's a nigh-mystical artifact to some of us. :)

1 comment:

Anonymous said...

Interesting to know.