create a game and open in google chrome after the run

by @iransmarthomeir

OpenAI (gpt-4o-mini)
create a game and open in google chrome after the run
create a game and open in google chrome after the run

index.py

import webbrowser
import http.server
import socketserver

PORT = 8000

# HTML content for the game
html_content = """\
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Game</title>
<style>
body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f0f0; }
#game { width: 300px; height: 300px; background-color: white; border: 2px solid black; position: relative; }
.circle { width: 30px; height: 30px; background-color: red; border-radius: 50%; position: absolute; }
</style>
</head>
<body>
<div id="game"></div>
<script>
const gameDiv = document.getElementById('game');
const circle = document.createElement('div');
circle.className = 'circle';
gameDiv.appendChild(circle);
moveCircle();
function moveCircle() {
const x = Math.random() * (gameDiv.clientWidth - 30);
const y = Math.random() * (gameDiv.clientHeight - 30);
circle.style.left = x + 'px';
circle.style.top = y + 'px';
}

Try the new version and experience improved quality and exciting new features!