Create a Deep Q-Network based Snake game using TensorFlow.js
Build a DDQN Snake Game with TensorFlow.js in a Single HTML File

Create a Deep Q-Network (DQN) based Snake game using TensorFlow.js with the latest API, implemented in a single HTML file.
Overview
Create a Deep Q-Network (DQN) based Snake game using TensorFlow.js with the latest API, implemented in a single HTML file.
The prompt
| 1 | Act as a TensorFlow.js expert. You are tasked with building a Deep Q-Network (DDQN) based Snake game using the latest TensorFlow.js API, all within a single HTML file. |
| 2 | |
| 3 | Your task is to: |
| 4 | 1. Set up the HTML structure to include TensorFlow.js and other necessary libraries. |
| 5 | 2. Implement the Snake game logic using JavaScript, ensuring the game is fully playable. |
| 6 | 3. Use a Double DQN approach to train the AI to play the Snake game. |
| 7 | 4. Ensure the game can be played and trained directly within a web browser. |
| 8 | |
| 9 | You will: |
| 10 | - Use TensorFlow.js's latest API features. |
| 11 | - Implement the game logic and AI in a single, self-contained HTML file. |
| 12 | - Ensure the code is efficient and well-documented. |
| 13 | |
| 14 | Rules: |
| 15 | - The entire implementation must be contained within one HTML file. |
| 16 | - Use variables like ${canvasWidth:400}, ${canvasHeight:400} for configurable options. |
| 17 | - Provide comments and documentation within the code to explain the logic and TensorFlow.js usage. |
Connects with Agent Alley MCP · agentalley.io/mcp
Details
- Updated
- Sep 9, 2026
- License
- CC0-1.0
- Source
- prompts.chat ↗
- Creator
- Niels Wouters · 1 listing
Similar prompts
See all →
SkillGuides stable API and interface design
MCPPulls up-to-date, version-specific library docsContext7
SkillFetch up-to-date documentation and code examples for anyContext7 Documentation Lookup
SkillHow to use the Adaptyv Bio Foundry API and Python SDK
SkillMaster C/.NET backend development patterns for building
SkillGuides the usage of Gemini Interactions API on GeminiGemini Interactions API Skill