Rename star-configurations to braille-configurations, fix, add tests

parent 88936c59
......@@ -3,7 +3,7 @@
#;(define (render-stars stars)
)
(define star-configurations
(define braille-configurations
#hash((#(#f #f
#f #f
#f #f
......@@ -926,7 +926,7 @@
SS SS) . #\⣥)
(#(#f #f
SS #f
SS #f
SS SS
SS SS) . #\⣦)
(#(SS #f
SS #f
......@@ -1029,6 +1029,34 @@
SS SS
SS SS) . #\⣿)))
(module+ test
(require rackunit)
(define (generate-permutations len)
(define all-permutations
(let lp ([len len])
(if (= len 1)
'((SS) (#f))
(foldl
(lambda (item prev)
(cons (cons 'SS item)
(cons (cons #f item)
prev)))
'()
(lp (sub1 len))))))
(map list->vector all-permutations))
(define all-permutations
(list->set (generate-permutations 8)))
(define missing-permutations
(set-subtract all-permutations
(list->set (hash-keys braille-configurations))))
(test-equal?
"No missing permutations"
missing-permutations (set)))
;; Periods make perfectly fine starfields, it appears...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment