2009-03-11 22:47:34 -04:00
|
|
|
(define (rule30-step b)
|
|
|
|
(let ((L (ash b -1))
|
2019-08-09 10:18:36 -04:00
|
|
|
(R (ash b 1)))
|
2009-03-11 22:47:34 -04:00
|
|
|
(let ((~b (lognot b))
|
2019-08-09 10:18:36 -04:00
|
|
|
(~L (lognot L))
|
|
|
|
(~R (lognot R)))
|
2009-03-11 22:47:34 -04:00
|
|
|
(logior (logand L ~b ~R)
|
2019-08-09 10:18:36 -04:00
|
|
|
(logand ~L b R)
|
|
|
|
(logand ~L b ~R)
|
|
|
|
(logand ~L ~b R)))))
|
2009-03-11 22:47:34 -04:00
|
|
|
|
|
|
|
(define (bin-draw s)
|
|
|
|
(string.map (lambda (c) (case c
|
2019-08-09 10:18:36 -04:00
|
|
|
(#\1 #\#)
|
|
|
|
(#\0 #\ )
|
|
|
|
(else c)))
|
|
|
|
s))
|
2009-03-11 22:47:34 -04:00
|
|
|
|
|
|
|
(for-each (lambda (n)
|
2019-08-25 15:57:31 -04:00
|
|
|
(displayln (bin-draw (string.lpad (number->string n 2) 63 #\0))))
|
2019-08-10 08:51:43 -04:00
|
|
|
(nestlist rule30-step (uint64 #x0000000080000000) 32))
|