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
class _Nodo: | |
def __init__(self,prim,prox=None): | |
self.prim=prim | |
self.prox=prox | |
class ListaEnlazada: | |
def __init__(self): | |
self.prim=None | |
self.len=0 | |
def append(self,dato): |
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
class _Nodo: | |
def __init__(self,dato,prox=None,ant=None): | |
self.dato=dato | |
self.prox=prox | |
self.ant=ant | |
class ListaDoble: | |
def __init__(self): | |
self.prim=None | |
self.len=0 | |
def append (self,dato): |
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
class TorreDeControl: | |
def __init__(self,aviones_aterrizan,aviones_despegan): | |
self.aviones=0 | |
self.aviones_aterrizan=aviones_aterrizan | |
self.aviones_despegan=aviones_despegan | |
def reconocimiento(self): | |
cola_aterrizar=Cola() | |
cola_despegar=Cola() | |
while self.aviones!=0: | |
for i in range (len(self.aviones_aterrizan)): |
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
import random | |
import objetos_tp3 | |
CANTIDAD_JUGADORES_MAXIMOS_PC=3 | |
COLORES_CARTAS=("amarillo","azul","verde","rojo") | |
CARTAS_ESPECIALES_CON_COLOR=("Invertir sentido","Saltear jugador","+2","Descartar mitad") | |
CARTAS_ESPECIALES_SIN_COLOR=("+4","Cambiar color") | |
NOMBRE_JUGADORES_PC=("Superman","Batichica","Guasón") | |
CANT_CARTAS_POR_COLOR=2 #de las que poseen color | |
VALOR_NUMERICO_MAXIMO=9 |
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
import random | |
class _Pila: | |
def __init__(self): | |
self.elementos=[] | |
def apilar (self,dato): | |
self.elementos.append(dato) | |
def obtener_tope(self): |
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
bool vector_guardar(vector_t* vector, size_t pos, int valor){ | |
//si accede a una posicion invalida en el vector | |
if ((pos<0) || (pos>=vector->tam)){ | |
return false; | |
} | |
//ahora si puede hacer la acción pedida | |
vector->datos[pos]=valor; | |
return true; | |
} |
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
#include "cola.h" | |
#include <stdlib.h> | |
#include <stdbool.h> | |
//Estructuras Cola y Nodo | |
struct nodo{ | |
void* dato; | |
struct nodo* sig; | |
} typedef nodo_t; |
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
#include "lista.h" | |
#include <stdlib.h> | |
#include <stdbool.h> | |
struct nodo{ | |
void* dato; | |
struct nodo* sig; | |
} typedef nodo_t; | |
struct lista{ |
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
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
/* | |
* Devuelve en un arreglo dinámico terminado en NULL con todos los subsegmentos | |
* de ‘str’ separados por el carácter ‘sep’. Tanto el arreglo devuelto como las | |
* cadenas que contiene son allocadas dinámicamente. | |
* | |
* Quien llama a la función toma responsabilidad de la memoria dinámica del |
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
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define NOMBRE_ARCHIVO "lorem.txt" | |
#define CANT_BYTES 24 | |
int crear_archivo (const char* nombre, char* cadena){ | |
FILE* nuevo_archivo; |
OlderNewer