New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

Create a Deep Q-Network based Snake game using TensorFlow.js

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

by Niels Wouters · CC0-1.0 license · updated Sep 9

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

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

17 lines · 946 characters · paste it into ChatGPT, Claude or Gemini
1Act 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
3Your task is to:
41. Set up the HTML structure to include TensorFlow.js and other necessary libraries.
52. Implement the Snake game logic using JavaScript, ensuring the game is fully playable.
63. Use a Double DQN approach to train the AI to play the Snake game.
74. Ensure the game can be played and trained directly within a web browser.
8
9You 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
14Rules:
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
View creator ↗

Similar prompts

See all →
SkillGuides stable API and interface designaddyosmani/agent-skills · by addyosmaniGuides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.★ 98.7k GitHub starsMCPPulls up-to-date, version-specific library docsContext7upstash/context7 · by upstashPulls up-to-date, version-specific library docs and code examples into the prompt so the AI stops inventing old APIs.★ 62.3k GitHub starsSkillFetch up-to-date documentation and code examples for anyContext7 Documentation Lookupupstash/context7 · by upstashFetch up-to-date documentation and code examples for any library, framework, SDK, CLI tool, or cloud service. Use whenever the user asks about a specific library — even well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot — because training data may not reflect recent API changes or version updates. Always use for: API syntax questions, configuration options, version migration issues, "how do I" questions mentioning a library name, debugging that involves library-specific behavior, setup instructions, and CLI tool usage. Use even when you think you know the answer. Do not rely on training data for API details, signatures, or configuration options — they are frequently out of date. Prefer this over web search for library documentation.★ 62.3k GitHub starsSkillHow to use the Adaptyv Bio Foundry API and Python SDKK-Dense-AI/scientific-agent-skills · by K-Dense-AIHow to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.★ 46k GitHub starsSkillMaster C/.NET backend development patterns for buildingwshobson/agents · by wshobsonMaster C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.★ 39.9k GitHub starsSkillGuides the usage of Gemini Interactions API on GeminiGemini Interactions API Skillgoogle/skills · by googleGuides the usage of Gemini Interactions API on Gemini Enterprise Agent Platform. Use when the user wants to use the stateful, server-managed Interactions API for multi-turn conversations, background execution, streaming, structured output, and function calling on the Agent Platform.★ 20.9k GitHub stars