-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.py
More file actions
33 lines (27 loc) · 776 Bytes
/
view.py
File metadata and controls
33 lines (27 loc) · 776 Bytes
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
from constants import Black, White, Placeable, Black_view, White_view, Place_view
# Fonction qui affiche un plateau
def affiche_plateau(plateau):
for ligne in plateau:
for pion in ligne:
print("[" + affiche_pion(pion) + "]",end="")
#retour a la ligne
print()
return
# Fonction qui affiche un pion en ASCII
def affiche_pion(pion):
if pion == Black:
return Black_view
elif pion == White:
return White_view
elif pion == Placeable:
return Place_view
else:
return " "
# Fonction qui affiche un pion en ASCII
def pion_style(pion):
if pion == Black:
return ("White","Black")
elif pion == White:
return ("Black","White")
else:
return ("Black","Gray")