Treasure Hunt is a fully static app — no build step, no package manager, and no dependencies to install. However, becauseDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/treasure-hunt-game/llms.txt
Use this file to discover all available pages before exploring further.
index.html loads app.js as a type="module" script, browsers enforce CORS rules that block module imports when a page is opened via the file:// protocol. Running a local HTTP server takes a single terminal command and sidesteps this entirely.
Why a Local Server Is Needed
The final line ofindex.html loads the game logic as an ES module:
app.js then imports from two sibling modules — treasure-maze.js and q-agent.js — using bare relative paths. Browsers treat file:// origins as opaque and refuse cross-file module imports under that scheme. In practice this means opening index.html by double-clicking it will produce a blank board and a CORS error in the DevTools console. Serving the files over http://localhost gives every module a proper origin and the imports resolve correctly.
Running with Python 3 (Recommended)
Python 3 ships with a zero-configuration static server. No install and no configuration file required.Open a terminal in the project folder
Navigate to the root of the repository — the directory that contains
index.html.Open the game in your browser
Visit http://localhost:8000. The game loads immediately — no build output to wait for.
All Server Options
type="module" imports that app.js requires. Open http://localhost:8000 in any case.
What to Expect When the Server Starts
Once the page loads you will see the full game interface immediately — no loading spinner or build output. Specifically:- A fresh randomized 8×8 maze is generated automatically via
createRandomMaze()inapp.js. - Both the player (●) and the agent (🤖) start at position
[0, 0]— the top-left cell. - The HUD above the board shows Ready in the status pill, reward at
0.00, and player and agent steps both at0. - The Game Log at the bottom displays the shortest route length for the current maze.
- The difficulty selector defaults to Medium.
File Structure Recap
Only two things need to be present for the game to run — the HTML entry point and theassets/ folder:
package.json, no node_modules, and no build output. The server serves these files as-is.
If the board renders but the agent does not appear on the grid, confirm that
app.js is loading as a type="module" script. Check the <script> tag at the bottom of index.html — it must read <script type="module" src="./assets/js/app.js"></script>. Also verify you are accessing the page over http://localhost and not the file:// protocol.