aboutsummaryrefslogtreecommitdiff
path: root/2022/day-05
diff options
context:
space:
mode:
Diffstat (limited to '2022/day-05')
-rw-r--r--2022/day-05/day-05.ipynb72
1 files changed, 60 insertions, 12 deletions
diff --git a/2022/day-05/day-05.ipynb b/2022/day-05/day-05.ipynb
index 70e0bc8..fa9374a 100644
--- a/2022/day-05/day-05.ipynb
+++ b/2022/day-05/day-05.ipynb
@@ -19,7 +19,11 @@
{
"cell_type": "code",
"execution_count": 1,
- "metadata": {},
+ "metadata": {
+ "vscode": {
+ "languageId": "racket"
+ }
+ },
"outputs": [],
"source": [
"(require racket\n",
@@ -40,8 +44,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 2,
+ "metadata": {
+ "vscode": {
+ "languageId": "racket"
+ }
+ },
"outputs": [],
"source": [
"(define assignments (~> (fetch-aoc-input (find-session) 2022 5) (string-split \"\\n\")))\n",
@@ -69,8 +77,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 3,
+ "metadata": {
+ "vscode": {
+ "languageId": "racket"
+ }
+ },
"outputs": [],
"source": [
"(struct instruction (n from to))\n",
@@ -96,9 +108,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "execution_count": 4,
+ "metadata": {
+ "vscode": {
+ "languageId": "racket"
+ }
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "<code>\"WHTLRMZRC\"</code>"
+ ],
+ "text/plain": [
+ "\"WHTLRMZRC\""
+ ]
+ },
+ "execution_count": 4,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
"(define (find-crate-message cs [reverse-function reverse])\n",
" (for/fold ([current-crates cs]\n",
@@ -124,9 +154,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "execution_count": 5,
+ "metadata": {
+ "vscode": {
+ "languageId": "racket"
+ }
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "<code>\"GMPMLWNMG\"</code>"
+ ],
+ "text/plain": [
+ "\"GMPMLWNMG\""
+ ]
+ },
+ "execution_count": 5,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
"(find-crate-message crates identity)"
]
@@ -142,7 +190,7 @@
"codemirror_mode": "scheme",
"file_extension": ".rkt",
"mimetype": "text/x-racket",
- "name": "racket",
+ "name": "Racket",
"pygments_lexer": "racket",
"version": "8.7"
},