Skip to content

Commit

Permalink
Merge pull request #94 from biralavor/91-adding-a-limitation-for-phil…
Browse files Browse the repository at this point in the history
…o-quantity

91 adding a limitation for philo quantity
  • Loading branch information
biralavor authored Nov 5, 2024
2 parents b1fb454 + ff43339 commit 4d490c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion philo/headers/philo.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: umeneses <umeneses@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/17 16:04:11 by umeneses #+# #+# */
/* Updated: 2024/11/04 18:54:34 by umeneses ### ########.fr */
/* Updated: 2024/11/05 11:17:35 by umeneses ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -35,6 +35,7 @@
# define RESET "\033[0m"

# define DEBUG_MODE 0
# define PHILOS_LIMIT 200

typedef enum e_mtx_opcode
{
Expand Down
4 changes: 3 additions & 1 deletion philo/src/03.parsing.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: umeneses <umeneses@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/22 16:16:16 by umeneses #+# #+# */
/* Updated: 2024/11/04 18:17:12 by umeneses ### ########.fr */
/* Updated: 2024/11/05 11:18:18 by umeneses ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -25,6 +25,8 @@ void table_parsing(t_table *table, char **av)
table->set.total_meals = ft_atoi_long_int(av[5]);
else
table->set.total_meals = -1;
if (table->set.total_philos > PHILOS_LIMIT)
table->set.total_philos = PHILOS_LIMIT;
if (table->set.time_to_die < 6e4
|| table->set.time_to_eat < 6e4
|| table->set.time_to_sleep < 6e4)
Expand Down

0 comments on commit 4d490c6

Please sign in to comment.