JUEGO: Familia en Cascada
¿Cuáles son las salidas?
¿Cuáles son las entradas?
¿Cuáles son las condiciones o restricciones?
¿Cuáles son los procesos o cálculos realizados?
def entero(text ) ok = False texto = raw_input(text) while not ok : texto = raw_input(text) ok = False try: texto = int(texto) ok = True if (texto 3) ok = False print "el numero no corresponde a alguna opción del menú, escoja una opción del 1 al 3" except: print "[",texto,"] no es un numero, o no es numero entero" return texto
def enterop(text): ok = False while not ok : texto = raw_input(text) ok = False try: texto = int(texto) ok = True if (texto 5) or (not VerificarPosicion(texto)): ok = False print "el numero no corresponde a algun jugador, ingrese un numero entre uno y cinco" except: print "[",texto,"] no es un numero, o no es numero entero" return texto
def VerificarPosicion(x): if x==0: return True if(lampara): if(LD[x-1]==1): return True else: if(LI[x-1]==1): return True return False
def prsonasnLD(): return LD def prsonasnLI(): return LI
def RestarT (x,y): global tiempo if y==-1: tiempo = tiempo - ContT[x] return if x==-1: tiempo= tiempo - ContT[y] return if ContT[x]>ContT[y]: tiempo= tiempo-ContT[x] else: tiempo= tiempo-ContT[y]
def Mov(x): global LD global LI if lampara== True: LD[x]=0 LI[x]=1 else: LD[x]=1 LI[x]=0
def CambiarLampara(): global lampara if lampara: lampara=False else: lampara=True
def WIN(): print '\n' print "Buen trabajo, has logrado lo que muchos no ;) " def LOOSER(): print '\n' print "UUUPS....! lo siento te has quedado sin tiempo.. :( "
def Todos(): for i in range(0,5): if(LD[i]==1): return False return True
def nuevojuego() global tiempo,lampara, LD, LI, ConT tiempo = 30 lampara = True LD = [1,1,1,1,1] LI = [0,0,0,0,0] ContT = [1,3,6,8,12]
Link para wiki: Link para video: INTEGRANTES: ALEJANDRA PAOLA VELASQUEZ BARILLAS vel12141 EMMA VERONICA ABAC SUCHI aba12383 VENUS ESMERALDACEBALLOS URRUELA ceb12088