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
#!/usr/bin/python | |
# A solution to N-Queens using the Min-Conflicts local search algorithm | |
# Vedant Kumar <vminch@gmail.com> | |
import random | |
def nqueens(nr): | |
show(min_conflicts(list(range(nr)), nr), nr) | |
def show(soln, nr): |
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
static void escape(void *p) { | |
asm volatile("" : : "g"(p) : "memory"); | |
} | |
static void clobber() { | |
asm volatile("" : : : "memory"); | |
} |