Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ $RECYCLE.BIN/
Network Trash Folder
Temporary Items
.apdisk
MATRIZ.C
45 changes: 26 additions & 19 deletions MATRIZ.C
Original file line number Diff line number Diff line change
Expand Up @@ -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 <malloc.h>
Expand Down Expand Up @@ -203,7 +209,8 @@
free(Mat[i]);
free(Mat);
return MAT_CondRetOK;
}
} /* Fim fun��o: MAT Criar Matriz */

/***************************************************************************
*
* Fun��o: MAT Destruir Matriz
Expand Down Expand Up @@ -296,7 +303,7 @@ MAT_tpCondRet MAT_CriarLista(LIS_tppLista * pLista)
*valor = *o;

return MAT_CondRetOK;
}
} /* Fim fun��o: MAT Obter Valor da lista */

/***************************************************************************
*
Expand All @@ -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)
Expand Down Expand Up @@ -362,7 +362,7 @@ MAT_tpCondRet MAT_CriarLista(LIS_tppLista * pLista)
}

return MAT_CondRetOK;
}
} /* Fim fun��o: MAT Avan�ar c�lula corrente */

/***************************************************************************
*
Expand All @@ -386,19 +386,19 @@ 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 )
{
IrFinalLista( lista );

return MAT_CondRetOK;
}
} /* Fim fun��o: MAT Ir final da lista */

/***************************************************************************
*
Expand All @@ -410,26 +410,33 @@ 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 )
{
if(LIS_AvancarElementoCorrente( pLista , numElem )!=LIS_CondRetOK)
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)
return MAT_CondRetErro;

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 **********/

10 changes: 9 additions & 1 deletion MATRIZ.H
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
typedef struct tgMatriz * tppMatriz;
/***********************************************************************
*
* $TC Tipo de dados: ARV Condicoes de retorno
* $TC Tipo de dados: MAT Condicoes de retorno
*
*
***********************************************************************/
Expand Down Expand Up @@ -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
*
***********************************************************************/

Expand Down
8 changes: 8 additions & 0 deletions RELATORIO-Tassio - Cópia.txt
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions RELATORIO-Tassio.txt
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 4 additions & 2 deletions TESTMAT.C
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,7 +31,7 @@
* $EIU Interface com o usu�rio pessoa
* Comandos de teste espec�ficos para testar o m�dulo Matriz:
*
* =criarmatriz <inxmat> <linha> <coluna> <CondRet> - Chama a fun��o MAT_CriarMatriz( inha, coluna, vtMatriz[inxmat])
* =criarmatriz <inxmat> <linha> <coluna> <CondRet> - Chama a fun��o MAT_CriarMatriz( linha, coluna, vtMatriz[inxmat])
* =criarlista <CondRet> - Chama a fun��o MAT_CriarLista( lista )
* =avancar <Dire��o> <inxmat> <CondRet> - 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.
Expand All @@ -45,7 +47,7 @@
e compara o charRecebido com o valor <Char>
* "=avancarelem" <numElem> <CondRet> - chama a fun��o MAT_AvancarElementoCorrente( lista, numElem )
*
* "=destruirmatriz" <inxmat> <CondRet> - Chama a fun��o -------
* "=destruirmatriz" <inxmat> <CondRet> - Chama a fun��o MAT_DestruirMatriz( vtMatriz[inxmat] )
***************************************************************************/

#include <string.h>
Expand Down
103 changes: 103 additions & 0 deletions teste.script
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -40,14 +94,19 @@
=avancar "Sul" 5 0
=avancar "Sul" 5 0

>>>>>>> Felipe-Visgou/branch1

== INSERIR CHAR
=inschardepois 'c' 0

== TESTAR OBTER VALOR 'C'
=obtervalorelem 'c' 0

<<<<<<< HEAD
== Inserir char 'a'
=======
== INserir char 'a'
>>>>>>> Felipe-Visgou/branch1
=inschardepois 'a' 0

== TESTAR OBTER VALOR 'a'
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion testebat.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gitproj0 /steste > log.txt
proj0 /steste > log.txt