{"id":"code-hs-readme-how-to-play-section","audience":"high-school","category":"coding","track":"coding","technique":"grounding","title":"Write a README 'How to play' section from your game's code","free":false,"task":"Your class game project needs a README section for classmates. Start with the exact heading '## How to play', then exactly 4 numbered steps, each under 15 words, using the controls the code really uses. The school Chromebooks can only start it with python3 -m http.server 8000, so put exactly that command alone in 1 code block. No other headings or sections, under 80 words outside the code.","materialLabel":"Your game files (attached to your prompt automatically)","material":"// game.js - \"Cloud Hopper\" (Intro to CS final project, by Dev and Sam)\n// Controls: W/A/D to move and jump, Esc to pause   (old, from v1)\n\nconst keys = {};\ndocument.addEventListener(\"keydown\", (e) => { keys[e.code] = true; });\ndocument.addEventListener(\"keyup\", (e) => { keys[e.code] = false; });\n\nfunction update(player) {\n  if (keys[\"ArrowLeft\"]) player.x -= 4;\n  if (keys[\"ArrowRight\"]) player.x += 4;\n  if (keys[\"Space\"] && player.onGround) player.vy = -12;\n  if (keys[\"KeyP\"]) togglePause();\n}\n\nfunction checkWin(player, flag) {\n  // reach the flag on the top cloud to win\n  return Math.abs(player.x - flag.x) < 20 && Math.abs(player.y - flag.y) < 20;\n}\n\nfunction checkLose(player, canvas) {\n  // falling off the bottom of the screen ends the game\n  return player.y > canvas.height;\n}\n\n// package.json\n{\n  \"name\": \"cloud-hopper\",\n  \"scripts\": { \"start\": \"npx serve .\" }\n}\n\n// index.html loads game.js; just open it through a local web server.\n// Tested on Chrome. Sam's laptop has Node but the school ones don't.","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":1},{"type":"maxProseWords","max":80}],"mistakes":[{"title":"Trusting the old comment","why":"The comment at the top still lists W/A/D and Esc, and the AI copies it.","fix":"Add: \"Use the controls from the code, not the comment.\"","checks":["r1"]},{"title":"The wrong start command","why":"The AI picks npm start from package.json, which won't run on the school Chromebooks.","fix":"Add: \"The only way to start it is python3 -m http.server 8000.\"","checks":["r2","maxCodeLines"]},{"title":"A full README","why":"Asked for a README, the AI writes Installation, Features, Credits and License sections.","fix":"Say: \"Only one section, heading exactly '## How to play'.\"","checks":["r0","codeBlocks"]},{"title":"Long steps","why":"The AI writes paragraphs that classmates won't read.","fix":"Add: \"Exactly 4 numbered steps, each under 15 words.\"","checks":["r1","maxProseWords"]}],"promptHints":[{"label":"Gives the heading","patterns":["how to play","heading"]},{"label":"Sets the number of steps","patterns":["\\b(4|four)\\b.{0,15}step","numbered"]},{"label":"Says to trust the code","patterns":["not the comment","from the code","arrow","space"]},{"label":"Gives the start command","patterns":["http\\.server","python3"]},{"label":"Limits it to one section","patterns":["only (one|that|this) section","no other (headings|sections)"]}],"hint":"The AI will write a whole README from the wrong comment. Tell it which section, how many steps, which controls are real, and the one command that works at school.","rubricLabels":["Starts with the exact heading '## How to play' and has no other headings or sections","Has exactly 4 numbered steps that use the real controls from the code (Left and Right arrow keys to move, Space to jump, P to pause), not W/A/D or Esc from the old comment","The only code block contains exactly python3 -m http.server 8000 and nothing else (not npm start or npx serve)"]}