no se si sedeva a  que mi funcion no evalua si la comparacion esta fuera de la matriz, solo evalua si es 0 o 1
				
			Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
 en las celulas que estan solas ai ariba no mueren por soledad
//El juego de la vida
#include <stdio.h>
#include <windows.h>
#include <time.h>
int columnas;
void gotoxy(int x,int y);
void dibujarrejilla(int fil, int col);
void dibujarCelula(int rejilla[][columnas], int filas, int col);
void llenarRejilla(int rejilla[][columnas], int filas, int col);
void comprobacion(int rejilla[][columnas], int filas, int col);
int main(){
    int filas, col;
    int i, j;
    printf("Coloque el numero de filas\n");
    scanf("%d", &filas);
    printf("Coloque el numero de columnas\n");
    scanf("%d", &col);
    columnas = col;
    int rejilla[filas][col];
    llenarRejilla(rejilla, filas, col);
    dibujarrejilla(filas, col);
    do{
    dibujarCelula(rejilla, filas, col);
    comprobacion(rejilla, filas, col);
    Sleep(1000);
    //getch();
    }while(1);
    getch();
    return 0;
}
void gotoxy(int x,int y){
      HANDLE hcon;
      hcon = GetStdHandle(STD_OUTPUT_HANDLE);
      COORD dwPos;
      dwPos.X = x;
      dwPos.Y= y;
      SetConsoleCursorPosition(hcon,dwPos);
 }
 void llenarRejilla(int rejilla[][columnas], int filas, int col){
    int i, j;
    srand(time(NULL));
     for(i=0; i<filas; i++){
        for(j=0; j<col; j++){
            rejilla[i][j]=rand()%2;
        }
     }
 }
 void dibujarrejilla(int fil, int col){
    int i, j;
    system("cls");
    for(i=0; i<fil; i++){
        for(j=0; j<col; j++){
            if(i==0){
                if(j==0){
                    gotoxy(i*2,j*2);
                    printf("%c%c",201,205);
                }else{
                    if((col-1) == j){
                       gotoxy(i*2,j*2);
                        printf("%c%c",200,205);
                        gotoxy(i*2,(j*2-1));
                        printf("%c",186);
                    }else{
                        gotoxy(i*2,j*2);
                        printf("%c%c",204,205);
                        gotoxy(i*2,(j*2-1));
                        printf("%c",186);
                    }
                }
            }else{
                if(j==0){
                    gotoxy(i*2,j*2);
                    printf("%c%c",203,205);
                }else{
                    if((col-1) == j){
                        gotoxy(i*2,j*2);
                        printf("%c%c",202,205);
                        gotoxy(i*2,(j*2-1));
                        printf("%c",186);
                    }else{
                        gotoxy(i*2,j*2);
                        printf("%c%c",206,205);
                        gotoxy(i*2,(j*2-1));
                        printf("%c",186);
                    }
                }
                if((fil-1) == i){
                        if(j==0){
                           gotoxy(i*2,j*2);
                            printf("%c ",187);
                        }else if((col-1) == j){
                            gotoxy(i*2,j*2);
                            printf("%c ",188);
                        }else{
                            gotoxy(i*2,j*2);
                            printf("%c ",185);
                        }
                }
            }
        }
    }
 }
 void dibujarCelula(int pos[][columnas], int filas, int col){
    int j, i;
    for(i=0; i<filas-1; i++){
        for(j=0; j<col-1; j++){
            if(pos[i][j] == 1){
                gotoxy((i*2)+1,(j*2)+1);
                printf("%c", 219);
            }else{
                gotoxy((i*2)+1,(j*2)+1);
                printf(" ");
            }
        }
    }
 }
 void comprobacion(int rejilla[][columnas], int filas, int col){
    int i, j, x, y, reja[filas][col], vivas;
    for(i=0; i<filas; i++){
        for(j=0; j<col; j++){
            if(rejilla[i][j] == 0){
                vivas = 0;
                for(x=0; x<3; x++){
                    for(y=0; y<3; y++){
                        if((i+1)-x == i && (j+1)-y == j){
                            reja[i][j] = rejilla[i][j];
                        }else if(rejilla[(i+1)-x][(j+1)-y] == 1){
                            vivas++;
                        }
                    }
                }
                if( vivas == 3){
                    reja[i][j] = 1;
                }
            }else if(rejilla[i][j] == 1){
                vivas = 0;
                for(x=0; x<3; x++){
                    for(y=0; y<3; y++){
                        if((i+1)-x == i && (j+1)-y == j){
                            reja[i][j] = rejilla[i][j];
                        }else if(rejilla[(i+1)-x][(j+1)-y] == 1){
                            vivas++;
                        }
                    }
                }
                if(vivas == 2 || vivas == 3){
                    reja[i][j] = 1;
                }else{
                    reja[i][j] = 0;
                }
            }
        }
    }
    for(i=0; i<filas; i++){
        for(j=0; j<col; j++){
            rejilla[i][j] = reja[i][j];
        }
    }
 }