Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Last One Tonight, I Promise(maybe)

Sign in to follow this  


#define LESS(first,second,temp,temp2) COPY(second,temp,temp2) \//temp=second;temp2=0;
TESTZERO(temp,temp2) \//temp=(temp==0);temp2=0;
IF(temp) \//if(temp){
ZERO(first) \// first=0;
ENDIF(temp) \//}temp=0;
WHILE(second) \//while(second){
COPY(first,temp,temp2) \// temp=first;temp2=0;
TESTZERO(temp) \// temp=(temp==0);temp2=0;
INC(temp2) \// temp2++;
IF(temp) \// if(temp){
DEC(temp2) \// temp2--;
SET(first,TRUE) \// first=TRUE;
ZERO(second) \// second=0;
ENDIF(temp) \// }temp=0;
IF(temp2) \// if(temp2){
DEC(first) \// first--;
DEC(second) \// second--;
COPY(second,temp,temp2) \// temp=second;temp2=0;
TESTZERO(temp,temp2) \// temp=(temp==0);temp2=0;
IF(temp) \// if(temp){
ZERO(first) \// first=0;
ENDIF(temp) \// }temp=0;
ENDIF(temp2) \// }temp2=0;
ENDWHILE(second) \//}

Look at the PITA it is to simply check if something is LESS than something else!

Of course, if it works, it means I never actually have to do it with the silly BF instructions, I can just use the macro, which means I can perform more useful, higher level work.

"Useful" being a rather questionable term here.
Sign in to follow this  


Recommended Comments

I must say you are quite clever. But that's a bit like a snail telling a bird he's a good flyer. [smile]

Share this comment

Link to comment
re: Diamondmaze

You ever play a game called Kroz, written by our esteemed colleague Scott Miller?

Share this comment

Link to comment
actually, I had never heard of Kroz prior to today.

Diamondmaze was a game that I wrote for an ex-girlfriend (written, of course, at a time when she was not my ex-girlfirend). She wanted "a game with keys and doors and monsters where you collect stuff", which is basically what DiamondMaze is.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!