small edits

2016
Matthew Butterick 8 years ago
parent 107965d5ee
commit 05eed96174

@ -16,12 +16,12 @@
(define-macro (solve . DISCS) (define-macro (solve . DISCS)
(with-pattern ([(DISC# ...) (generate-temporaries #'DISCS)] (with-pattern ([(DISC# ...) (generate-temporaries #'DISCS)]
[(DISC-SLOTS ...) #'DISCS]) [(DISC-SLOTS ...) #'DISCS])
#'(for/or ([DISC# (in-cycle DISC-SLOTS)] ... #'(for/first ([DISC# (in-cycle DISC-SLOTS)] ...
[i (in-naturals)] [i (in-naturals)]
#:when (= DISC# ...)) #:when (= 0 DISC# ...))
i))) i)))
(require sugar/list) (require sugar/list)
(define-macro (disc TIME-OFFSET SIZE _ START) (define-macro (disc TIME-OFFSET SIZE _ START)
#'(shift (range SIZE) (modulo (- (+ START TIME-OFFSET)) SIZE) #f #t)) #'(shift-left-cycle (range SIZE) (+ START TIME-OFFSET)))
(provide disc) (provide disc)

@ -1,6 +1,6 @@
#lang info #lang info
(define collection "aoc-racket") (define collection "aoc-racket")
(define scribblings '(("aoc-racket.scrbl" (multi-page)))) (define scribblings '(("aoc-racket.scrbl" (multi-page))))
(define deps '("base" "scribble-lib" "sugar" "rackunit-lib" "math-lib" "beautiful-racket-lib")) (define deps '("base" "scribble-lib" ("sugar" #:version "0.3") "rackunit-lib" "math-lib" "beautiful-racket-lib"))
(define test-omit-paths (list #rx"rkt$")) (define test-omit-paths (list #rx"rkt$"))
(define build-deps '("rackunit-lib" "racket-doc" "scribble-doc" "rackunit-doc" "at-exp-lib" "math-doc")) (define build-deps '("rackunit-lib" "racket-doc" "scribble-doc" "rackunit-doc" "at-exp-lib" "math-doc"))