Skip to content

Commit 7fe01a4

Browse files
committed
fix : minor issues fixed.
1 parent 07a8644 commit 7fe01a4

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

mafia.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ def index():
2323
if id > nPlayers:
2424
return "Numbers of players out of range!" #TODO:well defined Error Page
2525
role = roles[id]
26-
image_name = role + "_" + str(randrange(1, nRoles[role] + 1))
27-
ip2role_idx = (role, image_name)
26+
ip2role_idx[ip] = (role, str(randrange(1, nRoles[role] + 1)))
27+
image_name = role + "_" + str(ip2role_idx[ip][1])
2828
print("*" * 20, "New Player","*" * 20)
2929
print(ip + " : " + str(id) + " --> " + role)
3030
id += 1
3131
return render_template("index.html",
3232
image_name=image_name,
33-
role_name=role, rol_name_fa=role2fa[role],
33+
role_name=role, role_name_fa=role2fa[role],
34+
description=descriptions[role],
3435
player_id=id - 1,
3536
is_farsi=True)
3637

mafia_params.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@
1919
"Detective" : 1,
2020
"Anti-attack" : 1}
2121

22-
descriptions = {}
22+
descriptions = {"Don" : "Don is the boss of the mafia group. At night mode he'll decide whom to be killed from mafia team.",
23+
"Resident" : "Resident is the most simple player in the mafia game. he/she has no power but to blame mafia in order to remove them from game in day mode.",
24+
"Mafia" : "Mafia is the simple mafia player. they'll get up at night and try to decide which one of the peoples they want to kill.",
25+
"Doctor": "Doctor gets up after mafia team and try to rescue a person (or two in first night) from mafia's attack.",
26+
"Detector" : "Detector gets up after Doctor and try to ask GOD if someone is good (Resident, Doctor, Rebel, Anti-attack) <br>"
27+
"or bad(Mafia), but his/her first attempt to ask from Don may be answered incorrect by GOD.",
28+
"Rebel" : "Rebel gets up at night mode and kill a person.if the victim was chosen from residents Rebel (him/her)self may die",
29+
"Anti-attack" : "Anti-attack won't hurt from night shoots. he/she won't die through night mode."}
2330

2431
role2fa = {"Don" : "دن",
2532
"Resident" : "شهروند",

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Automatically generated by https://github.com/damnever/pigar.
2+
3+
# mafia/mafia.py: 3
4+
Flask == 1.1.2

static/css/style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,10 @@ th, td {
3232
.id_section {
3333
font-size: 10px;
3434
}
35+
36+
.description {
37+
text-align: justify;
38+
text-justify: auto;
39+
padding-left: 10%;
40+
padding-right: 10%;
41+
}

templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h2 id="fa">{{ role_name_fa }}</h2>
1717
{% endblock %}
1818

1919
{% block desc %}
20-
<p>...</p>
20+
<p>{{ description }}</p>
2121
{% if is_farsi == True %}
2222
<p id="fa">...</p>
2323
{% endif %}

0 commit comments

Comments
 (0)