Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,14 +41,11 @@ def make_html_file(generated_level):
|
|
| 41 |
<body>
|
| 42 |
</body>
|
| 43 |
<script>
|
| 44 |
-
const response = await fetch("/gradio_api/file=static/mario.jar");
|
| 45 |
-
const jarData = await response.arrayBuffer();
|
| 46 |
cheerpjInit().then(function () {{
|
| 47 |
cheerpjAddStringFile("/str/mylevel.txt", `{level_text}`);
|
| 48 |
-
await cheerpjAddStringFile("/str/mario.jar", new Uint8Array(jarData));
|
| 49 |
-
cheerpjCreateDisplay(512, 500);
|
| 50 |
-
cheerpjRunJar("/str/mario.jar");
|
| 51 |
}});
|
|
|
|
|
|
|
| 52 |
</script>
|
| 53 |
</html>''')
|
| 54 |
return html_filename # Return just the filename
|
|
|
|
| 41 |
<body>
|
| 42 |
</body>
|
| 43 |
<script>
|
|
|
|
|
|
|
| 44 |
cheerpjInit().then(function () {{
|
| 45 |
cheerpjAddStringFile("/str/mylevel.txt", `{level_text}`);
|
|
|
|
|
|
|
|
|
|
| 46 |
}});
|
| 47 |
+
cheerpjCreateDisplay(512, 500);
|
| 48 |
+
cheerpjRunJar("/gradio_api/file=static/mario.jar");
|
| 49 |
</script>
|
| 50 |
</html>''')
|
| 51 |
return html_filename # Return just the filename
|