-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
executable file
·49 lines (36 loc) · 1.12 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
#include "automate.h"
char print[SIZE_BUFF];
int main()
{
bool matched;
automate_s * machine = NULL;
bool refresh = true;
char str[SIZE_BUFF];
int choix;
do
{
if (refresh)
{
free_automate(machine);
machine = charger_automate("config");
}
affiche(machine, print);
choix = menu();
if(choix == 1)
{
mot_s * mot = input(str, NULL);
matched = appartenance(machine,mot,print);
status_appartenance(matched,mot);
}else if(choix == 2)
{
status_langage_vide(machine);
}else if(choix == 3)
{
status_langage_infini(machine);
}else{break;}
} while(again(&refresh));
sprintf(print,"\e[0m\e[1;25m\n\t\t\t::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n\t\t\t::\t\t BYE ::\n\t\t\t::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n");
print_and_clean(print,300);
free_automate(machine);
return EXIT_SUCCESS;
}