{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Project 1X \u2014 Shared Start\n",
    "\n",
    "Same adventure-game world as the Core track, same basic shape \u2014 a character, a branching choice, a small explorable space, an inventory. The difference is the bar: this project asks for three things Core's version doesn't."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Requirements\n",
    "\n",
    "1. **A character and a branching adventure** \u2014 at least the equivalent of Core's Projects 1A + 1B combined: a character with stats, at least one room-to-room loop, and a real branching decision\n",
    "2. **At least one function that does real work** \u2014 takes parameters, returns a value the rest of your program actually uses (not just a `print()`-only function)\n",
    "3. **Handles bad input gracefully** \u2014 if the player is asked for a number and types something that isn't one, your program should not crash. (Look into `try`/`except`, or validate with a loop that keeps re-asking until the input is usable \u2014 either approach is fine.)\n",
    "4. **A dictionary-based inventory** instead of a list \u2014 e.g. `inventory = {\"sword\": 1, \"healing potion\": 3}`, mapping item name to quantity (or to a short description \u2014 your call), with at least one addition and one lookup by key"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## A Note on Bad Input\n",
    "\n",
    "You haven't been taught `try`/`except` directly, but you've seen enough of Python's error behavior to reason about it. Two viable approaches:\n",
    "\n",
    "```python\n",
    "try:\n",
    "    gold = int(input(\"How much gold? \"))\n",
    "except ValueError:\n",
    "    gold = 0\n",
    "    print(\"That wasn't a number \u2014 defaulting to 0.\")\n",
    "```\n",
    "\n",
    "or, without `try`/`except`, a validation loop using `.isdigit()`:\n",
    "\n",
    "```python\n",
    "raw = input(\"How much gold? \")\n",
    "while not raw.isdigit():\n",
    "    raw = input(\"Please enter a number: \")\n",
    "gold = int(raw)\n",
    "```\n",
    "\n",
    "Either is acceptable \u2014 pick whichever makes more sense to you, or look up a third approach if you find one you understand well enough to explain."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Build your project here. Start from your own Project 1A/1B code if you have equivalent work,\n",
    "# or build fresh \u2014 just make sure all four requirements above are met.\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Before You Commit\n",
    "\n",
    "Test your bad-input handling on purpose \u2014 actually type letters where a number is expected, and confirm your program doesn't crash. Run the whole adventure twice with different choices."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## AI Collaboration Log\n",
    "\n",
    "If you used AI for any part of this project, log it here before you commit \u2014 same habit as your portfolio README:\n",
    "\n",
    "- What did you ask for?\n",
    "- What did you keep, and what did you change?\n",
    "\n",
    "*(If you didn't use AI this time, just write \"Didn't use AI for this one.\")*\n",
    "\n",
    "**Your log:** *(double-click to edit this cell)*"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "name": "python",
   "version": "3.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
