blob: 6aa1b15112fd912627edc254867999790072dd16 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# ############################################################################ #
# #
# ::: :::::::: #
# table.py :+: :+: :+: #
# +:+ +:+ +:+ #
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/27 12:44:48 by charles #+# #+# #
# Updated: 2020/09/27 12:54:01 by charles ### ########.fr #
# #
# ############################################################################ #
class Table:
def __init__(self, philo_num):
self._philos = [Philo(id_) for id_ in range(1, philo_num + 1)]
def update(self, match):
philo = itertools.first_true(self._philos, pred = lambda x: x.id == match.id)
philo.add_log(match)
def check(self):
return True
|