-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
56 lines (53 loc) · 1.25 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* @copyright João Paulo.
* Github: https://github.com/Joao-Paulo-Silva
* @author: João Paulo.
* @date: 22.04.2022
*/
#include <stdio.h>
#include <stdlib.h>
#include "./model/console-IO.h"
#include "./controll/gerenciaProdutos.h"
#include "./model/arvoreBinaria.h"
#include "./view/screens.h"
#include <locale.h>
int main(void) {
setlocale(LC_ALL, "Portuguese");
Tree * arvorePdt = _criarTree();
bool loop = true;
limpaConsole();
while(loop){
switch(menuInicial()){
case 1:{
insereProdutoArvore(arvorePdt);
limpaConsole();
break;
}
case 2:
limpaConsole();
if(mostraTodosArvore(arvorePdt)){
limpaConsole();
}else{
positionPrint(0, 13);
printf("\x1b[31m\033[1m\t✖ Não existem dados na árvore!\x1b[0m");
positionPrint(0, 0);
}
break;
case 3:
limpaConsole();
if(buscaDeletaProdutos(arvorePdt)){
limpaConsole();
}else{
positionPrint(0, 13);
printf("\x1b[31m\033[1m\t✖ Não existem dados na árvore!\x1b[0m");
positionPrint(0, 0);
}
break;
case 4:
destroiArvore(arvorePdt);
loop = false;
break;
}
}
return 0;
}