Skip to content
Snippets Groups Projects
Commit bb1bdfc1 authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Add lista do grupo inicial

parent 1cff850e
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include "libs/tabuleiro.h" #include "libs/tabuleiro.h"
#include "libs/no.h"
#include "libs/lista.h"
#include "libs/grafo.h" #include "libs/grafo.h"
int main() { int main() {
...@@ -13,8 +15,17 @@ int main() { ...@@ -13,8 +15,17 @@ int main() {
return -1; return -1;
} }
Grafo g = criaGrafo(); Grafo g = criaGrafo();
// Transforma o tabuleiro para um grafo
tabuleiroParaGrafo(t, g); tabuleiroParaGrafo(t, g);
// Lista com o grupo inicial
Lista grupo = constroiLista();
insereLista(t->celulas[0]->vert, grupo); // A célula na posição 0 do array é a célula no canto superior esquerdo
// Desaloca lista do grupo
destroiLista(grupo, NULL);
// Desaloca tabuleiro
destroiTblr(t); destroiTblr(t);
// Desaloca grafo
destroiGrafo(g); destroiGrafo(g);
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment