Build a DDQN Snake Game with TensorFlow.js in a Single HTML File
Prompt from prompts.chat: Build a DDQN Snake Game with TensorFlow.js in a Single HTML File
Prompt Content
Copy and paste directly into your model or internal evaluation tool.
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.
Your task is to:
- Set up the HTML structure to include TensorFlow.js and other necessary libraries.
- Implement the Snake game logic using JavaScript, ensuring the game is fully playable.
- Use a Double DQN approach to train the AI to play the Snake game.
- Ensure the game can be played and trained directly within a web browser.
You will:
- Use TensorFlow.js's latest API features.
- Implement the game logic and AI in a single, self-contained HTML file.
- Ensure the code is efficient and well-documented.
Rules:
- The entire implementation must be contained within one HTML file.
- Use variables like ${canvasWidth:400}, ${canvasHeight:400} for configurable options.
- Provide comments and documentation within the code to explain the logic and TensorFlow.js usage.
Use Cases
Reference Output
No standard answer available; manual review by scoring dimensions is recommended.
Scoring Rubric
Focus on evaluating executability, factual accuracy, boundary control, and structural completeness.
Try & save
Fill variables and copy, or save as a personal template.
This template has no variables and is ready to copy.
User Rating
0 ratingsYour rating
Log in to rate
Comments
0Log in to comment
Related Prompts
Dreamy Slow Shutter Fashion Portrait
Prompt from prompts.chat: Dreamy Slow Shutter Fashion Portrait
Shell Scripting taste
Prompt from prompts.chat: Shell Scripting taste
Web Performance taste
Prompt from prompts.chat: Web Performance taste