47 lines
1.2 KiB
HTML
47 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Pyodide Real-Time Python Execution with Console</title>
|
|
<script src="https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.js"></script>
|
|
<style>
|
|
#console {
|
|
width: 100%;
|
|
height: 200px;
|
|
background-color: black;
|
|
color: white;
|
|
font-family: monospace;
|
|
padding: 10px;
|
|
overflow-y: auto;
|
|
border: 1px solid #ccc;
|
|
}
|
|
|
|
#gameCanvas {
|
|
border: 1px solid black;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<h1>Real-Time Python Execution with Pyodide</h1>
|
|
<textarea id="python-code" rows="10" cols="50" placeholder="Enter your Python code here..."></textarea>
|
|
<br><br>
|
|
<button id="compile-button">Compile and Run</button>
|
|
<button id="pause-button">Pause</button>
|
|
<button id="reset-button">Reset</button>
|
|
|
|
<br><br>
|
|
<h2>Console Output:</h2>
|
|
<div id="console"></div>
|
|
|
|
<!-- Game canvas -->
|
|
<h2>2D Tank Simulation</h2>
|
|
<canvas id="gameCanvas" width="800" height="600"></canvas>
|
|
|
|
<script type="module" src="game.js"></script>
|
|
|
|
</body>
|
|
|
|
</html> |