-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_philo.c
34 lines (31 loc) · 1.31 KB
/
main_philo.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main_philo.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: stigkas <stigkas@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/27 11:12:51 by marvin #+# #+# */
/* Updated: 2024/04/16 09:42:09 by stigkas ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/philo.h"
int main(int ac, char **av)
{
t_table table;
if (ac == 5 || ac == 6)
{
if (get_input(&table, av, ac) == -1)
printf("Wrong input!\n");
else
{
if (!init_data(&table) || !lets_eat_spaghetti(&table, -1))
printf("It did not work, try again!!\n");
if (!clean_the_table(&table))
printf("Cleaning went wrong..\n");
}
}
else
printf("Wrong_input! Try: ./philo 5 800 200 200 [5]\n");
return (0);
}