Skip to content

Instantly share code, notes, and snippets.

@Ravenslofty
Last active August 29, 2017 18:10
Show Gist options
  • Save Ravenslofty/702f82563f81e2a7c40a7be3f521f8b8 to your computer and use it in GitHub Desktop.
Save Ravenslofty/702f82563f81e2a7c40a7be3f521f8b8 to your computer and use it in GitHub Desktop.
mailbox movegen
int * vector = dirs[<piece>];
while (*vector != 0) {
int nextsq = currsq + *vector;
while (board[nextsq] != OFFBOARD) {
AddMove(currsq, nextsq, <whatever>);
if (board[nextsq] != EMPTY || !slide[<piece>])
break;
nextsq += *vector;
}
*vector++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment