If you have no Invariant Sections, write \with no Invariant Sections" instead of saying which ones are invariant. If you have no Front-Cover Texts, write \no Front-Cover Texts" instead of \Front-Cover Texts being LIST"; likewise for Back-Cover Texts.If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
1: import random 2: class Carta: 3: listaDePalos = [ "Tr¶eboles" , "Diamantes" , "Corazones" , 4: "Picas" ] 5: listaDeValores = [ "nada" , "As" , "2" , "3" , "4" , "5" , "6" , "7" , 6: "8" , "9" , "10" , "Sota" , "Reina" , "Rey" ] 7: 8: def __init__(self, palo=0, valor=0): 9: self.palo = palo 10: self.valor = valor 11: def __str__(self): 12: return (self.listaDeValores[self.valor] + " de " +\ 13: self.listaDePalos[self.palo]) 14: def __cmp__(self, otro): 15: # controlar el palo 16: if self.palo > otro.palo: return 1 17: if self.palo < otro.palo: return -1 18: # si son del mismo palo, controlar el valor 19...
Comentarios
Publicar un comentario