diff --git a/.env b/.env index 845e741a..25cc43a0 100644 Binary files a/.env and b/.env differ diff --git a/src/AoC_2023/Dazbo's_Advent_of_Code_2023.ipynb b/src/AoC_2023/Dazbo's_Advent_of_Code_2023.ipynb index 700af32e..d7994ec1 100644 --- a/src/AoC_2023/Dazbo's_Advent_of_Code_2023.ipynb +++ b/src/AoC_2023/Dazbo's_Advent_of_Code_2023.ipynb @@ -47,19 +47,118 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "id": "9Dgeww1rMrkQ", "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: jupyterlab-lsp in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (5.0.0)\n", + "Requirement already satisfied: colorama in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (0.4.6)\n", + "Requirement already satisfied: python-dotenv in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (0.21.0)\n", + "Requirement already satisfied: ipykernel in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (6.25.0)\n", + "Requirement already satisfied: jupyter-lsp>=2.0.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyterlab-lsp) (2.2.0)\n", + "Requirement already satisfied: jupyterlab<5.0.0a0,>=4.0.6 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyterlab-lsp) (4.0.7)\n", + "Requirement already satisfied: comm>=0.1.1 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (0.1.2)\n", + "Requirement already satisfied: debugpy>=1.6.5 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (1.6.7)\n", + "Requirement already satisfied: ipython>=7.23.1 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (8.15.0)\n", + "Requirement already satisfied: jupyter-client>=6.1.12 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (7.4.9)\n", + "Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (5.3.0)\n", + "Requirement already satisfied: matplotlib-inline>=0.1 in c:\\users\\djl\\appdata\\roaming\\python\\python311\\site-packages (from ipykernel) (0.1.6)\n", + "Requirement already satisfied: nest-asyncio in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (1.5.6)\n", + "Requirement already satisfied: packaging in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (23.1)\n", + "Requirement already satisfied: psutil in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (5.9.0)\n", + "Requirement already satisfied: pyzmq>=20 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (25.1.1)\n", + "Requirement already satisfied: tornado>=6.1 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (6.3.3)\n", + "Requirement already satisfied: traitlets>=5.4.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipykernel) (5.7.1)\n", + "Requirement already satisfied: backcall in c:\\users\\djl\\appdata\\roaming\\python\\python311\\site-packages (from ipython>=7.23.1->ipykernel) (0.2.0)\n", + "Requirement already satisfied: decorator in c:\\users\\djl\\appdata\\roaming\\python\\python311\\site-packages (from ipython>=7.23.1->ipykernel) (5.1.1)\n", + "Requirement already satisfied: jedi>=0.16 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipython>=7.23.1->ipykernel) (0.18.1)\n", + "Requirement already satisfied: pickleshare in c:\\users\\djl\\appdata\\roaming\\python\\python311\\site-packages (from ipython>=7.23.1->ipykernel) (0.7.5)\n", + "Requirement already satisfied: prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipython>=7.23.1->ipykernel) (3.0.36)\n", + "Requirement already satisfied: pygments>=2.4.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipython>=7.23.1->ipykernel) (2.15.1)\n", + "Requirement already satisfied: stack-data in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from ipython>=7.23.1->ipykernel) (0.2.0)\n", + "Requirement already satisfied: entrypoints in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-client>=6.1.12->ipykernel) (0.4)\n", + "Requirement already satisfied: python-dateutil>=2.8.2 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-client>=6.1.12->ipykernel) (2.8.2)\n", + "Requirement already satisfied: platformdirs>=2.5 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-core!=5.0.*,>=4.12->ipykernel) (3.10.0)\n", + "Requirement already satisfied: pywin32>=300 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-core!=5.0.*,>=4.12->ipykernel) (305.1)\n", + "Requirement already satisfied: jupyter-server>=1.1.2 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-lsp>=2.0.0->jupyterlab-lsp) (2.10.0)\n", + "Requirement already satisfied: async-lru>=1.0.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (2.0.4)\n", + "Requirement already satisfied: jinja2>=3.0.3 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (3.1.2)\n", + "Requirement already satisfied: jupyterlab-server<3,>=2.19.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (2.22.0)\n", + "Requirement already satisfied: notebook-shim>=0.2 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (0.2.2)\n", + "Requirement already satisfied: parso<0.9.0,>=0.8.0 in c:\\users\\djl\\appdata\\roaming\\python\\python311\\site-packages (from jedi>=0.16->ipython>=7.23.1->ipykernel) (0.8.3)\n", + "Requirement already satisfied: MarkupSafe>=2.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jinja2>=3.0.3->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (2.1.1)\n", + "Requirement already satisfied: anyio>=3.1.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (3.5.0)\n", + "Requirement already satisfied: argon2-cffi in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (21.3.0)\n", + "Requirement already satisfied: jupyter-events>=0.6.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.6.3)\n", + "Requirement already satisfied: jupyter-server-terminals in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.4.4)\n", + "Requirement already satisfied: nbconvert>=6.4.4 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (6.5.4)\n", + "Requirement already satisfied: nbformat>=5.3.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (5.9.2)\n", + "Requirement already satisfied: overrides in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (7.4.0)\n", + "Requirement already satisfied: prometheus-client in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.14.1)\n", + "Requirement already satisfied: pywinpty in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (2.0.10)\n", + "Requirement already satisfied: send2trash>=1.8.2 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (1.8.2)\n", + "Requirement already satisfied: terminado>=0.8.3 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.17.1)\n", + "Requirement already satisfied: websocket-client in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.58.0)\n", + "Requirement already satisfied: babel>=2.10 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyterlab-server<3,>=2.19.0->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (2.11.0)\n", + "Requirement already satisfied: json5>=0.9.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyterlab-server<3,>=2.19.0->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (0.9.6)\n", + "Requirement already satisfied: jsonschema>=4.17.3 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyterlab-server<3,>=2.19.0->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (4.17.3)\n", + "Requirement already satisfied: requests>=2.28 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyterlab-server<3,>=2.19.0->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (2.31.0)\n", + "Requirement already satisfied: wcwidth in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30->ipython>=7.23.1->ipykernel) (0.2.5)\n", + "Requirement already satisfied: six>=1.5 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from python-dateutil>=2.8.2->jupyter-client>=6.1.12->ipykernel) (1.16.0)\n", + "Requirement already satisfied: executing in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from stack-data->ipython>=7.23.1->ipykernel) (0.8.3)\n", + "Requirement already satisfied: asttokens in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from stack-data->ipython>=7.23.1->ipykernel) (2.0.5)\n", + "Requirement already satisfied: pure-eval in c:\\users\\djl\\appdata\\roaming\\python\\python311\\site-packages (from stack-data->ipython>=7.23.1->ipykernel) (0.2.2)\n", + "Requirement already satisfied: idna>=2.8 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from anyio>=3.1.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (3.4)\n", + "Requirement already satisfied: sniffio>=1.1 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from anyio>=3.1.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (1.2.0)\n", + "Requirement already satisfied: pytz>=2015.7 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from babel>=2.10->jupyterlab-server<3,>=2.19.0->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (2023.3.post1)\n", + "Requirement already satisfied: attrs>=17.4.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jsonschema>=4.17.3->jupyterlab-server<3,>=2.19.0->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (23.1.0)\n", + "Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jsonschema>=4.17.3->jupyterlab-server<3,>=2.19.0->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (0.18.0)\n", + "Requirement already satisfied: python-json-logger>=2.0.4 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (2.0.7)\n", + "Requirement already satisfied: pyyaml>=5.3 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (6.0)\n", + "Requirement already satisfied: rfc3339-validator in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.1.4)\n", + "Requirement already satisfied: rfc3986-validator>=0.1.1 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.1.1)\n", + "Requirement already satisfied: lxml in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (4.9.3)\n", + "Requirement already satisfied: beautifulsoup4 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (4.12.2)\n", + "Requirement already satisfied: bleach in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (4.1.0)\n", + "Requirement already satisfied: defusedxml in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.7.1)\n", + "Requirement already satisfied: jupyterlab-pygments in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.1.2)\n", + "Requirement already satisfied: mistune<2,>=0.8.1 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.8.4)\n", + "Requirement already satisfied: nbclient>=0.5.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.5.13)\n", + "Requirement already satisfied: pandocfilters>=1.4.1 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (1.5.0)\n", + "Requirement already satisfied: tinycss2 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (1.2.1)\n", + "Requirement already satisfied: fastjsonschema in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from nbformat>=5.3.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (2.16.2)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from requests>=2.28->jupyterlab-server<3,>=2.19.0->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (2.0.4)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from requests>=2.28->jupyterlab-server<3,>=2.19.0->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (1.26.16)\n", + "Requirement already satisfied: certifi>=2017.4.17 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from requests>=2.28->jupyterlab-server<3,>=2.19.0->jupyterlab<5.0.0a0,>=4.0.6->jupyterlab-lsp) (2023.7.22)\n", + "Requirement already satisfied: argon2-cffi-bindings in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from argon2-cffi->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (21.2.0)\n", + "Requirement already satisfied: fqdn in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jsonschema[format-nongpl]>=3.2.0->jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (1.5.1)\n", + "Requirement already satisfied: isoduration in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jsonschema[format-nongpl]>=3.2.0->jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (20.11.0)\n", + "Requirement already satisfied: jsonpointer>1.13 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jsonschema[format-nongpl]>=3.2.0->jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (2.1)\n", + "Requirement already satisfied: uri-template in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jsonschema[format-nongpl]>=3.2.0->jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (1.3.0)\n", + "Requirement already satisfied: webcolors>=1.11 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from jsonschema[format-nongpl]>=3.2.0->jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (1.13)\n", + "Requirement already satisfied: cffi>=1.0.1 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from argon2-cffi-bindings->argon2-cffi->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (1.15.1)\n", + "Requirement already satisfied: soupsieve>1.2 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from beautifulsoup4->nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (2.5)\n", + "Requirement already satisfied: webencodings in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from bleach->nbconvert>=6.4.4->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (0.5.1)\n", + "Requirement already satisfied: pycparser in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (2.21)\n", + "Requirement already satisfied: arrow>=0.15.0 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from isoduration->jsonschema[format-nongpl]>=3.2.0->jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (1.3.0)\n", + "Requirement already satisfied: types-python-dateutil>=2.8.10 in f:\\users\\darren\\anaconda3\\envs\\ana-aoc\\lib\\site-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=3.2.0->jupyter-events>=0.6.0->jupyter-server>=1.1.2->jupyter-lsp>=2.0.0->jupyterlab-lsp) (2.8.19.14)\n", + "Note: you may need to restart the kernel to use updated packages.\n" + ] + } + ], "source": [ "%pip install jupyterlab-lsp colorama python-dotenv ipykernel " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": { "id": "p5Ki_HvOJUWk", "tags": [] @@ -109,7 +208,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": { "id": "SwzjfUFCKhXe", "tags": [] @@ -205,7 +304,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -265,9 +364,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[32m11:53:32.407:__main__ - INF: Using .env at F:\\Users\\Darren\\localdev\\Python\\Advent-of-Code\\.env\u001b[39m\n" + ] + }, + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "def get_envs_from_file() -> bool:\n", " \"\"\" Look for .env files, read variables from it, and store as environment variables \"\"\"\n", @@ -289,12 +406,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": { "id": "kSem0cT_LApT", "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[32m11:53:32.417:__main__ - INF: Session cookie retrieved: 53616c...13d33c\u001b[39m\n" + ] + } + ], "source": [ "if os.getenv('AOC_SESSION_COOKIE'):\n", " logger.info('Session cookie retrieved: %s...%s', os.environ['AOC_SESSION_COOKIE'][0:6], os.environ['AOC_SESSION_COOKIE'][-6:])\n", @@ -329,7 +454,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": { "id": "VK27bcGiK0_M", "tags": [] @@ -378,7 +503,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": { "id": "lwP0r3BAaxjt", "tags": [] @@ -410,7 +535,14 @@ " locations.input_dir.mkdir(parents=True, exist_ok=True)\n", "\n", " url = f\"https://adventofcode.com/{year}/day/{day}/input\"\n", - " cookies = {\"session\": session_cookie}\n", + " \n", + " # Don't think we need to set a user-agent\n", + " # headers = {\n", + " # \"User-Agent\": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'\n", + " # }\n", + " cookies = { \n", + " \"session\": session_cookie\n", + " }\n", " response = requests.get(url, cookies=cookies, timeout=5)\n", "\n", " data = \"\"\n", @@ -440,7 +572,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": { "id": "Y6nbd6WMryWi", "tags": [] @@ -468,7 +600,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": { "id": "A8sU4Ez_bBKl", "tags": [] @@ -644,7 +776,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": { "id": "DT5FSYliC9wp", "tags": [] @@ -746,7 +878,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": { "id": "sbdA-geUNqAF", "tags": [] @@ -784,12 +916,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": { "id": "6VoMC3MaJ1I9", "tags": [] }, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "#### See [Day 1](https://adventofcode.com/2023/day/1)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "DAY = 1\n", "day_link = f\"#### See [Day {DAY}](https://adventofcode.com/{YEAR}/day/{DAY}).\"\n", @@ -798,12 +943,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": { "id": "aNvM0hOF0tBR", "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[32m11:53:58.484:aoc2023 - INF: Session cookie retrieved: 53616c...13d33c\u001b[39m\n", + "\u001b[32m11:53:59.057:aoc2023 - INF: Input data:\n", + " 1: rhqrpdxsqhgxzknr2foursnrcfthree\n", + " 2: 2bmckl\n", + " 3: four95qvkvveight5\n", + " 4: 2tqbxgrrpmxqfglsqjkqthree6nhjvbxpflhr1eightwohr\n", + " 5: 7two68\n", + "...\n", + " 996: 18cfour\n", + " 997: xjtctnllkp57seven2jgbjmjbxnpfgone\n", + " 998: eight5gmbzbqtxrr27dtgfdbmtc7\n", + " 999: twoggvcnfmtrseven4dx\n", + "1000: ssevenhcltwoseven2cxrmxxcr\u001b[39m\n" + ] + } + ], "source": [ "d_name = \"d\" + str(DAY).zfill(2) # e.g. d01\n", "script_name = \"aoc\" + str(YEAR) + d_name # e.g. aoc2017d01\n", @@ -816,13 +981,12 @@ "# Retrieve input and store in local file\n", "try:\n", " write_puzzle_input_file(YEAR, DAY, locations)\n", - "except ValueError as e:\n", - " logger.error(e)\n", - "\n", - "with open(locations.input_file, mode=\"rt\") as f:\n", - " input_data = f.read().splitlines()\n", + " with open(locations.input_file, mode=\"rt\") as f:\n", + " input_data = f.read().splitlines()\n", "\n", - "logger.info(\"Input data:\\n%s\", top_and_tail(input_data))" + " logger.info(\"Input data:\\n%s\", top_and_tail(input_data))\n", + "except ValueError as e:\n", + " logger.error(e)" ] }, { @@ -837,7 +1001,7 @@ "\n", "Today was a troublesome start for me. My Internet was out. (Thanks, Virgin Media.) So, after unsuccessful restarts of the router and home network, I switched over to mobile hotspot.\n", "\n", - "Part 1 is pretty trivial, as we've come to expect. You need to identify the first and last digits of each line of a string, and add them together.\n", + "Part 1 is pretty trivial, as we've come to expect. You need to identify the first and last digits of each line of a string. Concatenating these two values gives you a two digit number, which the puzzle calls a _calibration value_. Then we just add them all together.\n", "\n", "**My Solution**\n", "\n", @@ -849,7 +1013,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -867,7 +1031,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "metadata": { "id": "rhWomZ6ewNi-", "tags": [] @@ -915,12 +1079,28 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": { "id": "uw4xFe7R7jf0", "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[32m10:43:02.688:aoc2023 - INF: Part 1 soln=55208\u001b[39m\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CPU times: total: 0 ns\n", + "Wall time: 2 ms\n" + ] + } + ], "source": [ "%%time\n", "sample_inputs = [[\"1abc2\", \"pqr3stu8vwx\", \"a1b2c3d4e5f\", \"treb7uchetabcdef\"]]\n", @@ -991,9 +1171,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "#### See [Day 2](https://adventofcode.com/2023/day/2)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "DAY = \"2\" # replace with actual number (without leading digit)\n", "logger.setLevel(logging.DEBUG)\n", @@ -1003,9 +1196,30 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[32m11:56:02.173:aoc2023 - INF: Session cookie retrieved: 53616c...13d33c\u001b[39m\n", + "\u001b[34m11:56:02.784:aoc2023 - DBG: Writing input file input.txt\u001b[39m\n", + "\u001b[32m11:56:02.791:aoc2023 - INF: Input data:\n", + " 1: Game 1: 9 red, 5 blue, 6 green; 6 red, 13 blue; 2 blue, 7 green, 5 red\n", + " 2: Game 2: 6 red, 2 green, 2 blue; 12 green, 11 red, 17 blue; 2 blue, 10 red, 11 green; 13 green, 17 red; 15 blue, 20 red, 3 green; 3 blue, 11 red, 1 green\n", + " 3: Game 3: 20 green, 1 blue, 7 red; 20 green, 7 blue; 18 red, 8 green, 3 blue; 7 red, 6 blue, 11 green; 11 red, 6 blue, 16 green\n", + " 4: Game 4: 6 blue, 6 green; 2 blue, 5 green, 1 red; 9 blue, 1 red, 1 green; 1 red, 6 green, 8 blue; 4 green, 1 red, 1 blue\n", + " 5: Game 5: 5 red, 4 blue, 11 green; 10 green, 3 blue, 18 red; 13 red, 13 green, 2 blue\n", + "...\n", + " 96: Game 96: 6 blue; 5 green, 2 blue, 2 red; 14 blue, 3 green\n", + " 97: Game 97: 1 blue, 2 green, 5 red; 2 green, 8 blue, 9 red; 1 green, 8 blue, 6 red; 1 blue, 17 red; 2 green, 10 blue, 11 red\n", + " 98: Game 98: 3 red, 12 blue, 2 green; 3 green, 4 blue, 4 red; 1 red, 11 blue, 2 green; 1 blue, 3 red\n", + " 99: Game 99: 2 green, 9 red; 8 red, 4 green, 9 blue; 8 blue, 13 red; 10 green, 8 blue, 6 red; 11 green, 2 red, 13 blue\n", + "100: Game 100: 5 blue, 2 green, 7 red; 14 red, 15 green, 1 blue; 3 blue, 3 red; 8 green, 10 red, 6 blue; 6 blue, 4 red, 8 green\u001b[39m\n" + ] + } + ], "source": [ "d_name = \"d\" + str(DAY).zfill(2) # e.g. d01\n", "script_name = \"aoc\" + str(YEAR) + d_name # e.g. aoc2017d01\n", @@ -1018,13 +1232,12 @@ "# Retrieve input and store in local file\n", "try:\n", " write_puzzle_input_file(YEAR, DAY, locations)\n", - "except ValueError as e:\n", - " logger.error(e)\n", + " with open(locations.input_file, mode=\"rt\") as f:\n", + " input_data = f.read().splitlines()\n", "\n", - "with open(locations.input_file, mode=\"rt\") as f:\n", - " input_data = f.read().splitlines()\n", - "\n", - "logger.info(\"Input data:\\n%s\", top_and_tail(input_data))" + " logger.info(\"Input data:\\n%s\", top_and_tail(input_data))\n", + "except ValueError as e:\n", + " logger.error(e)" ] }, { @@ -1061,7 +1274,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -1127,9 +1340,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[32m11:56:12.426:aoc2023 - INF: Part 1 soln=2278\u001b[39m\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CPU times: total: 0 ns\n", + "Wall time: 2 ms\n" + ] + } + ], "source": [ "%%time\n", "sample_inputs = [[\"Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green\",\n", @@ -1168,7 +1397,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ @@ -1191,9 +1420,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[32m11:56:15.862:aoc2023 - INF: Part 2 soln=67953\u001b[39m\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CPU times: total: 0 ns\n", + "Wall time: 1 ms\n" + ] + } + ], "source": [ "%%time\n", "sample_inputs = [[\"Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green\",\n", @@ -1222,9 +1467,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "#### See [Day 3](https://adventofcode.com/2023/day/3)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "DAY = \"3\" # replace with actual number (without leading digit)\n", "logger.setLevel(logging.DEBUG)\n", @@ -1234,9 +1492,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[32m11:55:17.391:aoc2023 - INF: Session cookie retrieved: 53616c...13d33c\u001b[39m\n", + "\u001b[31m11:55:17.923:aoc2023 - ERR: Unable to retrieve input data.\n", + "HTTP response: 404\n", + "Not Found: Please don't repeatedly request this endpoint before it unlocks! The calendar countdown is synchronized with the server time; the link will be enabled on the calendar the instant this puzzle becomes available.\u001b[39m\n" + ] + } + ], "source": [ "d_name = \"d\" + str(DAY).zfill(2) # e.g. d01\n", "script_name = \"aoc\" + str(YEAR) + d_name # e.g. aoc2017d01\n", @@ -1249,13 +1518,12 @@ "# Retrieve input and store in local file\n", "try:\n", " write_puzzle_input_file(YEAR, DAY, locations)\n", - "except ValueError as e:\n", - " logger.error(e)\n", - "\n", - "with open(locations.input_file, mode=\"rt\") as f:\n", - " input_data = f.read().splitlines()\n", + " with open(locations.input_file, mode=\"rt\") as f:\n", + " input_data = f.read().splitlines()\n", "\n", - "logger.info(\"Input data:\\n%s\", top_and_tail(input_data))" + " logger.info(\"Input data:\\n%s\", top_and_tail(input_data))\n", + "except ValueError as e:\n", + " logger.error(e)" ] }, { @@ -1367,13 +1635,12 @@ "# Retrieve input and store in local file\n", "try:\n", " write_puzzle_input_file(YEAR, DAY, locations)\n", - "except ValueError as e:\n", - " logger.error(e)\n", - "\n", - "with open(locations.input_file, mode=\"rt\") as f:\n", - " input_data = f.read().splitlines()\n", + " with open(locations.input_file, mode=\"rt\") as f:\n", + " input_data = f.read().splitlines()\n", "\n", - "logger.info(\"Input data:\\n%s\", top_and_tail(input_data))" + " logger.info(\"Input data:\\n%s\", top_and_tail(input_data))\n", + "except ValueError as e:\n", + " logger.error(e)" ] }, { diff --git a/src/AoC_2023/d01/input/input.txt b/src/AoC_2023/d01/input/input.txt index d1a5032c..642f12dd 100644 Binary files a/src/AoC_2023/d01/input/input.txt and b/src/AoC_2023/d01/input/input.txt differ diff --git a/src/AoC_2023/d02/input/input.txt b/src/AoC_2023/d02/input/input.txt index 3eef4068..c40c2de9 100644 Binary files a/src/AoC_2023/d02/input/input.txt and b/src/AoC_2023/d02/input/input.txt differ