diff --git a/.gitignore b/.gitignore index 96374c4..e5cc819 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ $RECYCLE.BIN/ Network Trash Folder Temporary Items .apdisk +MATRIZ.C diff --git a/MATRIZ.C b/MATRIZ.C index a6d9ae8..9dfcce0 100644 --- a/MATRIZ.C +++ b/MATRIZ.C @@ -9,15 +9,21 @@ * Projeto: Disciplinas INF 1628 / 1301 * Gestor: DI/PUC-Rio * Autores: avs - Arndt von Staa +* fvc - Felipe Vieira Côrtes +* tbm - Tássio Borges de Miranda +* db - Daniela Brazão * * $HA Histórico de evolução: * Versão Autor Data Observações - 4.00 Mudança no módulo para operar matrizes +* 4.00 fvc 28/08/2015 Mudança no módulo para operar matrizes * 3.00 avs 28/02/2003 Uniformização da interface das funções e * de todas as condições de retorno. * 2.00 avs 03/08/2002 Eliminação de código duplicado, reestruturação * 1.00 avs 15/08/2001 Início do desenvolvimento * +* $ED Descrição do módulo +* Este módulo contém as funções do módulo Matriz. +* ***************************************************************************/ #include @@ -203,7 +209,8 @@ free(Mat[i]); free(Mat); return MAT_CondRetOK; - } + } /* Fim função: MAT Criar Matriz */ + /*************************************************************************** * * Função: MAT Destruir Matriz @@ -296,7 +303,7 @@ MAT_tpCondRet MAT_CriarLista(LIS_tppLista * pLista) *valor = *o; return MAT_CondRetOK; - } + } /* Fim função: MAT Obter Valor da lista */ /*************************************************************************** * @@ -305,13 +312,6 @@ MAT_tpCondRet MAT_CriarLista(LIS_tppLista * pLista) MAT_tpCondRet MAT_Avancar( tppMatriz matriz, char* direcao ) { - /* fazer um switch case - case (strcmp("Norte", direcao)) - matriz->corrente->origem = matriz->corrente->N - ... - ... - ... - */ if(strcmp("Norte", direcao) == 0) { if(matriz->Corrente->N == NULL) @@ -362,7 +362,7 @@ MAT_tpCondRet MAT_CriarLista(LIS_tppLista * pLista) } return MAT_CondRetOK; - } + } /* Fim função: MAT Avançar célula corrente */ /*************************************************************************** * @@ -386,11 +386,11 @@ MAT_tpCondRet MAT_CriarLista(LIS_tppLista * pLista) cel->lista = pLista; return MAT_CondRetOK; - } + } /* Fim função: MAT INserir lista na célula da matriz */ /*************************************************************************** * -* Função: ARMAT Ir final da lista +* Função: MAT Ir final da lista * ****/ MAT_tpCondRet MAT_IrFinal( LIS_tppLista lista ) @@ -398,7 +398,7 @@ MAT_tpCondRet MAT_CriarLista(LIS_tppLista * pLista) IrFinalLista( lista ); return MAT_CondRetOK; - } + } /* Fim função: MAT Ir final da lista */ /*************************************************************************** * @@ -410,9 +410,12 @@ MAT_tpCondRet MAT_CriarLista(LIS_tppLista * pLista) IrInicioLista( lista ); return MAT_CondRetOK; - } - + } /* Fim função: MAT Ir inicio da lista */ + /*************************************************************************** + * + * Função: MAT Avancar o elemento corrente da lista + * ****/ MAT_tpCondRet MAT_AvancarElementoCorrente( LIS_tppLista pLista , int numElem ) { @@ -420,8 +423,12 @@ MAT_tpCondRet MAT_AvancarElementoCorrente( LIS_tppLista pLista , return MAT_CondRetErro; return MAT_CondRetOK; -} +} /* Fim função: MAT Avancar o elemento corrente da lista */ +/*************************************************************************** +* +* Função: MAT Excluir o elemento da lista +* ****/ MAT_tpCondRet MAT_ExcluirElemento( LIS_tppLista pLista ) { if(LIS_ExcluirElemento( pLista )!=LIS_CondRetOK) @@ -429,7 +436,7 @@ MAT_tpCondRet MAT_AvancarElementoCorrente( LIS_tppLista pLista , return MAT_CondRetOK; -} +} /* Fim função: MATExcluir o elemento da lista */ -/********** Fim do módulo de implementação: Módulo árvore **********/ +/********** Fim do módulo de implementação: Módulo Matriz **********/ diff --git a/MATRIZ.H b/MATRIZ.H index a44ab49..3bbe907 100644 --- a/MATRIZ.H +++ b/MATRIZ.H @@ -41,7 +41,7 @@ typedef struct tgMatriz * tppMatriz; /*********************************************************************** * -* $TC Tipo de dados: ARV Condicoes de retorno +* $TC Tipo de dados: MAT Condicoes de retorno * * ***********************************************************************/ @@ -98,6 +98,14 @@ typedef struct tgMatriz * tppMatriz; * * $FC Função: MAT Destruir Matriz * +* $ED Descrição da função +* Destrói a lista atrelada a cada célula da matriz e a própria matriz +* +* $EP Parâmetros +* M - Matriz que se deseja destruir. +* +* $FV Valor retornado +* MAT_CondRetOK - Destrui sem problemas * ***********************************************************************/ diff --git "a/RELATORIO-Tassio - C\303\263pia.txt" "b/RELATORIO-Tassio - C\303\263pia.txt" new file mode 100644 index 0000000..bdd1c3d --- /dev/null +++ "b/RELATORIO-Tassio - C\303\263pia.txt" @@ -0,0 +1,8 @@ +Data Horas Trabalhadas Descrição da Tarefa Realizada +14/08 4 Estudar +18/08 2 Estudar, Projetar, Codigo Modulo +19/08 2 Especificar Modulos, Especificar Funcoes, realizar testes +24/08 2 Projetar, Revisar codigo modulo, diagnosticar e corrigir problemas encontrados +25/08 2 Redigir script de teste, Revisar script de teste, +26/08 2 Realizar testes, diagnosticar e corrigir problemas encontrados +28/08 1 Revisar Projetos, diagnosticar e corrigir problemas encontrados \ No newline at end of file diff --git a/RELATORIO-Tassio.txt b/RELATORIO-Tassio.txt new file mode 100644 index 0000000..9c52e87 --- /dev/null +++ b/RELATORIO-Tassio.txt @@ -0,0 +1,8 @@ +Data Horas Trabalhadas Tipo de Tarefa Descrição da Tarefa Realizada +14/08 4 Estudar Foi estudado a descrição do trabalho e o arcabouco, suas funcionalidades e documentações +18/08 2 Estudar, Projetar Finalização da leitura da documentação, inicio da projeção do trabalho, elaborar quais funções criar equais modificar +19/08 2 Especificar Modulos, Especificar Funcoes, Codificar Modulo Especificar os novos modulos/funções e modificar os antigos. Inicio da codificação da criamatriz. +24/08 2 Revisar Projetos, Revisar codigo modulo, Codificar Modulo, realizar testes Revisar e testar o codigo da criamatriz e iniciar a projeção e codificação da função destroi matriz +25/08 2 Revisar codigo modulo, Redigir script de teste, Revisar script de teste, Revisar e testar o codigo da destroimatriz, redigir teste de srcipts para matriz +26/08 2 Realizar testes,Codificar Modulo, diagnosticar e corrigir problemas encontrados Revisar e testar de todos as funções, corrigir problemas encontrados e codificar inserelista. +28/08 1 Revisar Projetos, diagnosticar e corrigir problemas encontrados Revisar os scripts de teste e procurar por erros nas funções através dos scripts. \ No newline at end of file diff --git a/TESTMAT.C b/TESTMAT.C index e25d3ce..41f4007 100644 --- a/TESTMAT.C +++ b/TESTMAT.C @@ -12,6 +12,8 @@ * Gestor: DI/PUC-Rio * Autores: avs - Arndt von Staa fvc - Felipe Vieira Cortes +* tbm - Tássio Borges de Miranda +* db - Daniela Brazão * * $HA Histórico de evolução: * Versão Autor Data Observações @@ -29,7 +31,7 @@ * $EIU Interface com o usuário pessoa * Comandos de teste específicos para testar o módulo Matriz: * -* =criarmatriz - Chama a função MAT_CriarMatriz( inha, coluna, vtMatriz[inxmat]) +* =criarmatriz - Chama a função MAT_CriarMatriz( linha, coluna, vtMatriz[inxmat]) * =criarlista - Chama a função MAT_CriarLista( lista ) * =avancar - Chama a função MAT_Avancar(vtMatriz[inxmat], direcao ) * e avança a célula corrente da matriz de acordo com a direção dada. @@ -45,7 +47,7 @@ e compara o charRecebido com o valor * "=avancarelem" - chama a função MAT_AvancarElementoCorrente( lista, numElem ) * -* "=destruirmatriz" - Chama a função ------- +* "=destruirmatriz" - Chama a função MAT_DestruirMatriz( vtMatriz[inxmat] ) ***************************************************************************/ #include diff --git a/teste.script b/teste.script index 65cc911..64c3747 100644 --- a/teste.script +++ b/teste.script @@ -10,7 +10,11 @@ == CRIAR MATRIZ 2 - 2x1 =criarmatriz 2 2 1 0 +<<<<<<< HEAD +== CRIAR MATRIZ 3 - 1x1 +======= == CRIAR MATRIZ 3 - 7x2 +>>>>>>> Felipe-Visgou/branch1 =criarmatriz 3 1 1 0 == CRIAR MATRIZ 4 - 7x2 @@ -19,6 +23,56 @@ == CRIAR MATRIZ 5 - 9x7 =criarmatriz 5 9 7 0 +<<<<<<< HEAD +== CRIAR MATRIZ 6 - 3x3 +=criarmatriz 6 3 3 0 + +== CRIAR MATRIZ 7 - 10x10 +=criarmatriz 7 10 10 0 + +== CRIAR MATRIZ 8 - 20x20 +=criarmatriz 8 20 20 0 + +== CRIAR MATRIZ 9 - 1x2 +=criarmatriz 9 1 2 0 + +== CRIAR MATRIZ ERRADA (-1x-100) +=criarmatriz 6 -1 -100 1 + +== AVANCAR COM O CORRENTE DA MATRIZ 0 O LESTE +=avancar "Leste" 0 0 + +== AVANCAR COM O CORRENTE DA MATRIZ 0 PARA O SUL +=avancar "Sul" 0 0 + +== AVANCAR COM O CORRENTE DA MATRIZ 0 PARA O SUL (ERRADO) +=avancar "Sul" 0 1 + +== AVANCAR COM O CORRENTE DA MATRIZ 2 PAR AO NORTE (ERRADO) +=avancar "Norte" 1 1 + +== AVANCAR LESTE 2 VEZES NA MATRIZ 7 (10x10) +=avancar "Leste" 7 0 +=avancar "Leste" 7 0 +== AVANCAR SUDESTE NA MATRIZ 7 (10x10) +=avancar "Sudeste" 7 0 +== AVANCAR SUL NA MATRIZ 7 (10x10) +=avancar "Sul" 7 0 +== AVANCAR SUDOESTE NA MATRIZ 7 (10x10) +=avancar "Sudoeste" 7 0 +== AVANCAR OESTE NA MATRIZ 7 (10x10) +=avancar "Oeste" 7 0 +== AVANCAR NOROESTE NA MATRIZ 7 (10x10) +=avancar "Noroeste" 7 0 +== AVANCAR NORTE NA MATRIZ 7 (10x10) +=avancar "Norte" 7 0 +== AVANCAR NORDESTE NA MATRIZ 7 (10x10) +=avancar "Nordeste" 7 0 + +== CRIAR LISTA +=criarlista 0 + +======= == CRIAR MATRIZ ERRADA =criarmatriz 6 -1 25 1 @@ -40,6 +94,7 @@ =avancar "Sul" 5 0 =avancar "Sul" 5 0 +>>>>>>> Felipe-Visgou/branch1 == INSERIR CHAR =inschardepois 'c' 0 @@ -47,7 +102,11 @@ == TESTAR OBTER VALOR 'C' =obtervalorelem 'c' 0 +<<<<<<< HEAD +== Inserir char 'a' +======= == INserir char 'a' +>>>>>>> Felipe-Visgou/branch1 =inschardepois 'a' 0 == TESTAR OBTER VALOR 'a' @@ -72,8 +131,16 @@ =excluirelem 0 =obtervalorelem 'c' 0 +<<<<<<< HEAD +== TESTAR IR INICIO E OBTER O VALOR DO CHAR 'c' +=irinicio 0 +=obtervalorelem 'c' 0 + +== Inserir a lista na matriz 0 (2x2) na célula 1x2 +======= == Inserir a lista na matriz +>>>>>>> Felipe-Visgou/branch1 =inslista 0 1 2 0 == CRIAR LISTA @@ -95,8 +162,44 @@ == INSERIR A LISTA NA MATRIZ 5 (9x7) NA CELULA 8x4 =inslista 5 8 4 0 +<<<<<<< HEAD +== CRIAR LISTA +=criarlista 0 + +== INSERIR CARACTERES NA LISTA +=inschardepois 'a' 0 +=inschardepois 'j' 0 +=inschardepois 'u' 0 +=inschardepois 'd' 0 +=inschardepois 'a' 0 + +== Inserir lista na celula 10x10 da matriz 7 (10x10) +=inslista 7 10 10 0 + +== DESTRUIR MATRIZ 0 +=destruirmatriz 0 0 +== DESTRUIR MATRIZ 1 +=destruirmatriz 1 0 +== DESTRUIR MATRIZ 2 +=destruirmatriz 2 0 +== DESTRUIR MATRIZ 3 +=destruirmatriz 3 0 +== DESTRUIR MATRIZ 4 +=destruirmatriz 4 0 +== DESTRUIR MATRIZ 5 +=destruirmatriz 5 0 +== DESTRUIR MATRIZ 6 +=destruirmatriz 6 0 +== DESTRUIR MATRIZ 7 +=destruirmatriz 7 0 +== DESTRUIR MATRIZ 8 +=destruirmatriz 8 0 +== DESTRUIR MATRIZ 9 +=destruirmatriz 9 0 +======= == INSERIR CHAR '!' =inschardepois '!' 0 == DESTRUIR MATRIZ 0 =destruirmatriz 0 0 +>>>>>>> Felipe-Visgou/branch1 diff --git a/testebat.bat b/testebat.bat index 2681b03..f7615e7 100644 --- a/testebat.bat +++ b/testebat.bat @@ -1 +1 @@ -gitproj0 /steste > log.txt \ No newline at end of file +proj0 /steste > log.txt \ No newline at end of file