JRQi commited on
Commit
3fc83f7
β€’
1 Parent(s): f10eece

Update game3.py

Browse files
Files changed (1) hide show
  1. game3.py +11 -5
game3.py CHANGED
@@ -79,18 +79,24 @@ def func3(num_selected, human_predict, num1, num2, user_important):
79
  # user_select += "nothing. Interesting! "
80
  user_select += "Wanna see how the AI made the guess? Click here. ⬅️"
81
 
82
-
 
 
 
 
 
 
83
  if abs(golden_label - human_predict) <= 20 and abs(golden_label - ai_predict) <= 20:
84
- chatbot.append(("The correct answer is " + str(golden_label) + ". Congratulations! πŸŽ‰ Both of you get the correct answer!", user_select))
85
  num1 += 1
86
  num2 += 1
87
  elif abs(golden_label - human_predict) > 20 and abs(golden_label - ai_predict) > 20:
88
- chatbot.append(("The correct answer is " + str(golden_label) + ". Sorry.. No one gets the correct answer. But nice try! πŸ˜‰", user_select))
89
  elif abs(golden_label - human_predict) <= 20 and abs(golden_label - ai_predict) > 20:
90
- chatbot.append(("The correct answer is " + str(golden_label) + ". Great! πŸŽ‰ You are closer to the answer and better than AI!", user_select))
91
  num1 += 1
92
  else:
93
- chatbot.append(("The correct answer is " + str(golden_label) + ". Sorry.. AI wins in this round.", user_select))
94
  num2 += 1
95
 
96
  tot_scores = ''' ### <p style="text-align: center;"> Machine &ensp; ''' + str(int(num2)) + ''' &ensp; VS &ensp; ''' + str(int(num1)) + ''' &ensp; Human </p>'''
 
79
  # user_select += "nothing. Interesting! "
80
  user_select += "Wanna see how the AI made the guess? Click here. ⬅️"
81
 
82
+ if golden_label > 60:
83
+ gender = ' (female)'
84
+ elif golden_label < 40:
85
+ gender = ' (male)'
86
+ else:
87
+ gender = ' (neutral)'
88
+
89
  if abs(golden_label - human_predict) <= 20 and abs(golden_label - ai_predict) <= 20:
90
+ chatbot.append(("The correct answer is " + str(golden_label) + gender + ". Congratulations! πŸŽ‰ Both of you get the correct answer!", user_select))
91
  num1 += 1
92
  num2 += 1
93
  elif abs(golden_label - human_predict) > 20 and abs(golden_label - ai_predict) > 20:
94
+ chatbot.append(("The correct answer is " + str(golden_label) + gender + ". Sorry.. No one gets the correct answer. But nice try! πŸ˜‰", user_select))
95
  elif abs(golden_label - human_predict) <= 20 and abs(golden_label - ai_predict) > 20:
96
+ chatbot.append(("The correct answer is " + str(golden_label) + gender + ". Great! πŸŽ‰ You are closer to the answer and better than AI!", user_select))
97
  num1 += 1
98
  else:
99
+ chatbot.append(("The correct answer is " + str(golden_label) + gender + ". Sorry.. AI wins in this round.", user_select))
100
  num2 += 1
101
 
102
  tot_scores = ''' ### <p style="text-align: center;"> Machine &ensp; ''' + str(int(num2)) + ''' &ensp; VS &ensp; ''' + str(int(num1)) + ''' &ensp; Human </p>'''