Spaces:
Sleeping
Sleeping
Update game1.py
Browse files
game1.py
CHANGED
|
@@ -155,16 +155,17 @@ def func1(lang_selected, num_selected, human_predict, num1, num2, user_important
|
|
| 155 |
if lang_selected in ['en']:
|
| 156 |
# 0 1 2 3 4 5 6 7 8 9 10
|
| 157 |
if ai_predict == golden_label:
|
| 158 |
-
if abs(human_predict - golden_label)
|
| 159 |
golden_label = int((human_predict + ai_predict) / 2)
|
| 160 |
ai_predict = golden_label
|
| 161 |
chatbot.append(("The correct answer is " + str(golden_label) + ". Congratulations! π Both of you get the correct answer!", user_select))
|
| 162 |
num1 += 1
|
| 163 |
num2 += 1
|
| 164 |
else:
|
| 165 |
-
golden_label +=
|
| 166 |
while golden_label > 10 or golden_label < 0:
|
| 167 |
-
golden_label +=
|
|
|
|
| 168 |
ai_predict = golden_label
|
| 169 |
chatbot.append(("The correct answer is " + str(golden_label) + ". Sorry.. AI wins in this round.", user_select))
|
| 170 |
num2 += 1
|
|
@@ -172,7 +173,8 @@ def func1(lang_selected, num_selected, human_predict, num1, num2, user_important
|
|
| 172 |
if abs(human_predict - golden_label) < abs(ai_predict - golden_label):
|
| 173 |
if abs(human_predict - golden_label) < 2:
|
| 174 |
golden_label = int((golden_label + human_predict) / 2)
|
| 175 |
-
ai_predict +=
|
|
|
|
| 176 |
chatbot.append(("The correct answer is " + str(golden_label) + ". Great! π You are closer to the answer and better than AI!", user_select))
|
| 177 |
num1 += 1
|
| 178 |
else:
|
|
@@ -203,6 +205,7 @@ def func1(lang_selected, num_selected, human_predict, num1, num2, user_important
|
|
| 203 |
while golden_label > 10:
|
| 204 |
golden_label = human_predict + random.randint(-1, 1)
|
| 205 |
ai_predict = int(ai_predict)
|
|
|
|
| 206 |
chatbot.append(("The correct answer is " + str(golden_label) + ". Great! π You are close to the answer and better than AI!", user_select))
|
| 207 |
num1 += 1
|
| 208 |
else:
|
|
|
|
| 155 |
if lang_selected in ['en']:
|
| 156 |
# 0 1 2 3 4 5 6 7 8 9 10
|
| 157 |
if ai_predict == golden_label:
|
| 158 |
+
if abs(human_predict - golden_label) <= 2: # Both correct
|
| 159 |
golden_label = int((human_predict + ai_predict) / 2)
|
| 160 |
ai_predict = golden_label
|
| 161 |
chatbot.append(("The correct answer is " + str(golden_label) + ". Congratulations! π Both of you get the correct answer!", user_select))
|
| 162 |
num1 += 1
|
| 163 |
num2 += 1
|
| 164 |
else:
|
| 165 |
+
golden_label += random.randint(-1, 1) * 0.5
|
| 166 |
while golden_label > 10 or golden_label < 0:
|
| 167 |
+
golden_label += random.randint(-1, 1) * 0.5
|
| 168 |
+
golden_label = int(golden_label)
|
| 169 |
ai_predict = golden_label
|
| 170 |
chatbot.append(("The correct answer is " + str(golden_label) + ". Sorry.. AI wins in this round.", user_select))
|
| 171 |
num2 += 1
|
|
|
|
| 173 |
if abs(human_predict - golden_label) < abs(ai_predict - golden_label):
|
| 174 |
if abs(human_predict - golden_label) < 2:
|
| 175 |
golden_label = int((golden_label + human_predict) / 2)
|
| 176 |
+
ai_predict += random.randint(-1, 1) * 0.5
|
| 177 |
+
ai_predict = int(ai_predict)
|
| 178 |
chatbot.append(("The correct answer is " + str(golden_label) + ". Great! π You are closer to the answer and better than AI!", user_select))
|
| 179 |
num1 += 1
|
| 180 |
else:
|
|
|
|
| 205 |
while golden_label > 10:
|
| 206 |
golden_label = human_predict + random.randint(-1, 1)
|
| 207 |
ai_predict = int(ai_predict)
|
| 208 |
+
golden_label = int(golden_label)
|
| 209 |
chatbot.append(("The correct answer is " + str(golden_label) + ". Great! π You are close to the answer and better than AI!", user_select))
|
| 210 |
num1 += 1
|
| 211 |
else:
|