small edits

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

@ -16,12 +16,12 @@
(define-macro (solve . DISCS)
(with-pattern ([(DISC# ...) (generate-temporaries #'DISCS)]
[(DISC-SLOTS ...) #'DISCS])
#'(for/or ([DISC# (in-cycle DISC-SLOTS)] ...
[i (in-naturals)]
#:when (= DISC# ...))
i)))
#'(for/first ([DISC# (in-cycle DISC-SLOTS)] ...
[i (in-naturals)]
#:when (= 0 DISC# ...))
i)))
(require sugar/list)
(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)

@ -1,6 +1,6 @@
#lang info
(define collection "aoc-racket")
(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 build-deps '("rackunit-lib" "racket-doc" "scribble-doc" "rackunit-doc" "at-exp-lib" "math-doc"))