Documentos de Académico
Documentos de Profesional
Documentos de Cultura
m = f + i;
n = c + j;
funciones.h
#include <stdint.h>
funciones.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <conio.h>
#include "funciones.h"
uint8_t getEstado(celda c) {
return (c & 0xF0) >> 4;
}
uint8_t getVecindad(celda c) {
return (c & 0x0F);
}
m = f + i;
n = c + j;
main.c
#include "funciones.h"
#include "funciones.c"
int main()
{
celda mundo[_SIZE][_SIZE];
uint16_t bichos;
bichos = inicializarMundo(_SIZE, mundo, _DENSIDAD);
while(bichos)
{
system("cls");
contarVecinos(_SIZE, mundo);
mostrarMundo(_SIZE, mundo);
bichos = supervivencia(_SIZE, mundo);
usleep(_TIEMPO);
// getch();
}
return 0;
}