Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang racket
- (require rackunit)
- ;;;Takes transitions in form of '((A B C)...)
- ;;;outputs hashtable in form of '((A . B) C)
- (define (transitions->hash ts)
- (define (transform t) (cons (cons (first t) (second t)) (third t)))
- (make-hash (map transform ts)))
- (check-equal? [transitions->hash '((1 2 3))]
- #hash([(1 . 2) . 3]))
Add Comment
Please, Sign In to add comment