code-battles 1.5.2 → 1.5.4
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.
|
@@ -480,7 +480,9 @@ class CodeBattles(
|
|
|
480
480
|
self.step = 0
|
|
481
481
|
self.active_players = list(range(len(self.player_names)))
|
|
482
482
|
self.random = Random(seed)
|
|
483
|
-
self.player_randoms = [
|
|
483
|
+
self.player_randoms = [
|
|
484
|
+
Random(self.random.randint(0, 2**128)) for _ in self.player_names
|
|
485
|
+
]
|
|
484
486
|
self.state = self.create_initial_state()
|
|
485
487
|
self.player_requests = [
|
|
486
488
|
self.create_initial_player_requests(i)
|
|
@@ -18,13 +18,15 @@ def is_worker():
|
|
|
18
18
|
|
|
19
19
|
return False
|
|
20
20
|
except Exception:
|
|
21
|
-
return
|
|
21
|
+
return is_web_or_worker()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def is_web_or_worker():
|
|
25
|
+
return "MicroPython" in sys.version or "pyodide" in sys.executable
|
|
22
26
|
|
|
23
27
|
|
|
24
28
|
def is_web():
|
|
25
|
-
return (
|
|
26
|
-
"MicroPython" in sys.version or "pyodide" in sys.executable
|
|
27
|
-
) and not is_worker()
|
|
29
|
+
return is_web_or_worker() and not is_worker()
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
def web_only(method):
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-battles",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "A library for building interactive competitive coding battles",
|
|
5
5
|
"repository": "https://github.com/noamzaks/code-battles",
|
|
6
6
|
"homepage": "https://code-battles.readthedocs.org",
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
"tsparticles": "^3.5.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@mantine/core": "^7.13.
|
|
42
|
-
"@mantine/dates": "^7.13.
|
|
43
|
-
"@mantine/dropzone": "^7.13.
|
|
44
|
-
"@mantine/hooks": "^7.13.
|
|
45
|
-
"@mantine/notifications": "^7.13.
|
|
41
|
+
"@mantine/core": "^7.13.5",
|
|
42
|
+
"@mantine/dates": "^7.13.5",
|
|
43
|
+
"@mantine/dropzone": "^7.13.5",
|
|
44
|
+
"@mantine/hooks": "^7.13.5",
|
|
45
|
+
"@mantine/notifications": "^7.13.5",
|
|
46
46
|
"firebase": "^11.0.1",
|
|
47
47
|
"react": "^18.3.1",
|
|
48
48
|
"react-dom": "^18.3.1",
|
|
49
|
-
"react-router-dom": "^6.
|
|
49
|
+
"react-router-dom": "^6.28.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@pyscript/core": "^0.5.16",
|