Created
November 1, 2010 22:03
-
-
Save jsoffer/658953 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from os import system as run | |
def pars(x): return (x*"(" + "1" + x*")") | |
def programa(x): return "int main () { return " + pars(x) + "; }\n" | |
# rango seleccionado al tanteo, manipulando para encontrar el primero que falla | |
for i in range(2**16 + 2**15 + 2**13 + 2**10,2**17): | |
print "---------- " + str(i) + " ----------" | |
fh = open ("parens.c", "w") | |
fh.write(programa(i)) | |
fh.flush() | |
fh.close() | |
print "+++" | |
run ("gcc -Wall parens.c") | |
# No va a ser interrumpido por Ctrl-C; hace falta | |
# hacer Ctrl-Z y matar el proceso 'python' padre. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment