InnerVault

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

Indexedprompts.chat (CC0 prompt collection), niels@wwx.be

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…

Open the source (opens github.com) https://github.com/f/prompts.chat

What it is

Prompts from niels@wwx.be.

The problem it solves and who it suits haven't been reviewed by InnerVault. The description above is the source's own.

The prompt

Fill in before using: ${canvasWidth:400} ${canvasHeight:400}

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.

Written by the prompts.chat (CC0 prompt collection) community (niels@wwx.be). Not tested by InnerVault.

How to get it

Setup steps: not applicable.

Related

  1. I want you to act as an expert HTML5 Canvas game developer. Your task is to write a complete, playable SINGLE FILE (index.html) game based on a modernized snake mechanic. GAME SPEC: Title: Cyber Grid Link Core…

    Indexed prompts.chat (CC0 prompt collection), loshu2000 CC0-1.0

  2. Pitch

    Prompts

    Write mean eye catching pitch

    Indexed prompts.chat (CC0 prompt collection), ballerfx1@gmail.com CC0-1.0

  3. Temitope

    Prompts

    Always act like one fill with wisdom and be extraordinary

    Indexed prompts.chat (CC0 prompt collection), adediwuratemitope9-tech CC0-1.0

  4. Give me note book to learn Spanish with Myanmar translation

    Indexed prompts.chat (CC0 prompt collection), thinn666@gmail.com CC0-1.0

  5. Self-summary

    Prompts

    Give me a summary of what you know about me so far

    Indexed prompts.chat (CC0 prompt collection), monapdx CC0-1.0

  6. subculture

    Prompts

    Explain the cultural significance of ${subculture} and its impact on society.

    Indexed prompts.chat (CC0 prompt collection), etnologiaus2022@gmail.com CC0-1.0