Skip to content

Instantly share code, notes, and snippets.

@arknave
Last active Dec 10, 2020
Embed
What would you like to do?
// Say you have an integer array of length n. Then this monstrosity sorts it, slowly.
void cursed_sort(int* a, int n) {
int*q,i;
for(i=0;i<n;++i)
for(q=a;q+1<a+n;++q)
if(*q>*(q+1))
*q^=*(q+1)^=*q^=*(q+1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment