-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
45 lines (35 loc) · 990 Bytes
/
main.py
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
from node import Node
from network import Network
ascii_art = '''
`7MMF' `7MF'`7MM"""Mq. .M"""bgd
`MA ,V MM `MM. ,MI "Y
VM: ,V MM ,M9 `MMb.
MM. M' MMmmdM9 `YMMNq.
`MM A' MM YM. . `MM
:MM; MM `Mb. Mb dM
VF .JMML. .JMM.P"Ybmmd"
Vouch Reputation System
Bruno Rocha Moura
'''
print(ascii_art)
network = Network()
adam = network.add_node("Adam")
eve = network.add_node("Eve")
cain = network.add_node("Cain")
abel = network.add_node("Abel")
peter = network.add_node("Peter")
adam.vouch("Eve", True)
adam.vouch("Cain", True)
adam.vouch("Abel", True)
eve.vouch("Adam", True)
eve.vouch("Cain", True)
eve.vouch("Abel", True)
cain.vouch("Adam", True)
cain.vouch("Eve", True)
cain.vouch("Abel", False)
cain.vouch("Peter", True)
abel.vouch("Adam", True)
abel.vouch("Eve", True)
peter.vouch("Cain", True)
#peter.vouch("Abel", False)
network.calculate_reputation("Adam")