code-battles 1.7.4 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/code_battles/battles.py +19 -16
- package/package.json +1 -1
|
@@ -1035,22 +1035,25 @@ class CodeBattles(
|
|
|
1035
1035
|
from js import document
|
|
1036
1036
|
|
|
1037
1037
|
if not self.over:
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
self.
|
|
1052
|
-
|
|
1053
|
-
|
|
1038
|
+
# loop waiting for decisions to be ready then break.
|
|
1039
|
+
while True:
|
|
1040
|
+
if len(self._decisions) == self._decision_index:
|
|
1041
|
+
await asyncio.sleep(0.01)
|
|
1042
|
+
continue
|
|
1043
|
+
else:
|
|
1044
|
+
logs = self._logs[self._decision_index]
|
|
1045
|
+
for log in logs:
|
|
1046
|
+
console_log(
|
|
1047
|
+
-1 if log["player_index"] is None else log["player_index"],
|
|
1048
|
+
log["text"],
|
|
1049
|
+
log["color"],
|
|
1050
|
+
)
|
|
1051
|
+
alerts = self._alerts[self._decision_index]
|
|
1052
|
+
for alert in alerts:
|
|
1053
|
+
self.alert(**alert)
|
|
1054
|
+
self.apply_decisions(self._decisions[self._decision_index])
|
|
1055
|
+
self._decision_index += 1
|
|
1056
|
+
break
|
|
1054
1057
|
|
|
1055
1058
|
if not self.over:
|
|
1056
1059
|
self.step += 1
|
package/package.json
CHANGED