ipIterPrompt

Build a DDQN Snake Game with TensorFlow.js in a Single HTML File

Turn any AI chat into a build a ddqn snake game with tensorflow.js in a single html file with this community persona prompt.

niels@wwx.be · awesome-chatgpt-promptsUpdated 2026-05-274,452 copies

Build a DDQN Snake Game with TensorFlow.js in a Single HTML File is a community-contributed prompt from awesome-chatgpt-prompts (CC0). Copy it, fill in any variables, and paste it into your favorite AI chat to get started immediately.

The prompt

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:
1. Set up the HTML structure to include TensorFlow.js and other necessary libraries.
2. Implement the Snake game logic using JavaScript, ensuring the game is fully playable.
3. Use a Double DQN approach to train the AI to play the Snake game.
4. 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.

Run this prompt on a real model without leaving the page. Every run is saved to your history for this prompt.

How to use

  1. 1Copy the prompt as-is — no variables required.
  2. 2Paste it into ChatGPT, Claude, Gemini, or any capable model.
  3. 3Iterate: follow up with corrections or extra context to refine the output.

Related

Django Unit Test Generator for Viewsets

Turn any AI chat into a django unit test generator for viewsets with this community persona prompt.

3,681 copiesOpen ↗

Spring Boot + SOLID Specialist

Turn any AI chat into a spring boot + solid specialist with this community persona prompt.

3,163 copiesOpen ↗

Visual Web Application Development

Turn any AI chat into a visual web application development with this community persona prompt.

3,103 copiesOpen ↗

Customizable Web Template for Company Branding

Turn any AI chat into a customizable web template for company branding with this community persona prompt.

1,011 copiesOpen ↗