This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require threading) | |
(define (get-input) | |
(map string->number (string-split (car (file->lines "day13.txt")) ","))) | |
(define test-code '(109 1 204 -1 1001 100 1 100 1008 100 16 101 1006 101 0 99)) | |
(define test-code2 '(1102 34915192 34915192 7 4 7 99 0)) | |
(define test-code3 '(104 1125899906842624 99)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require threading) | |
(define indata 59734319985939030811765904366903137260910165905695158121249344919210773577393954674010919824826738360814888134986551286413123711859735220485817087501645023012862056770562086941211936950697030938202612254550462022980226861233574193029160694064215374466136221530381567459741646888344484734266467332251047728070024125520587386498883584434047046536404479146202115798487093358109344892308178339525320609279967726482426508894019310795012241745215724094733535028040247643657351828004785071021308564438115967543080568369816648970492598237916926533604385924158979160977915469240727071971448914826471542444436509363281495503481363933620112863817909354757361550) | |
(define inpattern (vector 0 1 0 -1)) | |
(define (data->list data) | |
(~>> (number->string data) | |
(string->list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require threading) | |
(require racket/generator) | |
(define (get-input) | |
(map string->number (string-split (car (file->lines "day19.txt")) ","))) | |
(define test-code '(109 1 204 -1 1001 100 1 100 1008 100 16 101 1006 101 0 99)) | |
(define test-code2 '(1102 34915192 34915192 7 4 7 99 0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require threading) | |
(provide deal-into cut deal-with-increment factory-order shuffle-stk parse ) | |
(define (get-input) | |
(file->string "day22.txt")) | |
(define (parse cmds) | |
(define (line-to-lambda ln) | |
(cond |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang typed/racket | |
(require typed/openssl/md5) | |
(provide | |
get-md5-string | |
init-zero-string | |
glue-string-number | |
hash-with-50 | |
part1 | |
part2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang typed/racket | |
(require threading) | |
(: get-input (-> (Listof String))) | |
(define (get-input) | |
(file->lines "day6.txt")) | |
(struct pt ([x : Integer] [y : Integer]) #:transparent) | |
(struct ins ([cmd : Symbol] [from : pt] [to : pt]) #:transparent) | |
(define-type Grid (Immutable-HashTable pt Integer)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require threading) | |
(define (get-input) | |
(file->lines "day7.txt")) | |
(struct part (cmd a b to) #:transparent) | |
(define (string->param str) | |
(if str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require threading) | |
(define (get-input) | |
(file->lines "day8.txt")) | |
(define (str-len str) | |
(if (= 0 (string-length str)) | |
0 | |
(string-length (read (open-input-string str))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require threading) | |
(define (get-input) | |
(file->lines "day9.txt")) | |
(struct edge (from to dist) #:transparent) | |
(struct step (from to) #:transparent) | |
(define (parse-line str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require threading) | |
(define input "1321131112") | |
(define (parse str) | |
(~>> str | |
(string->list) | |
(map char->integer) | |
(map (curry + -48)))) |