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 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 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) | |
(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) | |
(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) | |
(require racket/set) | |
(struct point (x y z) #:transparent) | |
(struct velocity (x y z) #:transparent) | |
(struct moon (position velocity) #:transparent) | |
(define (get-input) |
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 "day11.txt")) ","))) | |
(define (get-test-input) | |
(map string->number (string-split (car (file->lines "day9.txt")) ","))) |
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 | |
(define (get-input) | |
(map string->number (string-split (car (file->lines "day9.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 test-img '(((0 2) | |
(2 2)) | |
((1 1) | |
(2 2)) | |
((2 2) | |
(1 2)) | |
((0 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 | |
(define (get-input) | |
(map string->number (string-split (car (file->lines "day5.txt")) ","))) | |
(struct parameter (value immediate) #:transparent) | |
(struct opcode (op a b c) #:transparent) | |
(define (run-code code input) | |
(define (decode-op code ip) |