Last active
August 29, 2015 14:09
-
-
Save stevenpetryk/230ff9f8c4269eeb73b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int earliestHitInChain(Attack * attacks[]) { | |
int i; | |
for(i = MAX_ATTACKS-1; i > 0; i--) { | |
if(attacks[i] != NULL && attacks[i]->result == HIT && attacks[i-1]->result == MISS) | |
return i; | |
} | |
return -1; // didn't find anything | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment