2009-03-11 22:47:34 -04:00
|
|
|
; -*- scheme -*-
|
|
|
|
|
|
|
|
(define (rule30-step b)
|
|
|
|
(let ((L (ash b -1))
|
|
|
|
(R (ash b 1)))
|
|
|
|
(let ((~b (lognot b))
|
|
|
|
(~L (lognot L))
|
|
|
|
(~R (lognot R)))
|
|
|
|
(logior (logand L ~b ~R)
|
|
|
|
(logand ~L b R)
|
|
|
|
(logand ~L b ~R)
|
|
|
|
(logand ~L ~b R)))))
|
|
|
|
|
|
|
|
(define (bin-draw s)
|
|
|
|
(string.map (lambda (c) (case c
|
|
|
|
(#\1 #\#)
|
|
|
|
(#\0 #\ )
|
|
|
|
(else c)))
|
|
|
|
s))
|
|
|
|
|
|
|
|
(for-each (lambda (n)
|
|
|
|
(begin
|
2009-03-28 17:39:04 -04:00
|
|
|
(princ (bin-draw (pad-l (number->string n 2) 63 #\0)))
|
2009-03-26 23:06:55 -04:00
|
|
|
(newline)))
|
2009-03-11 22:47:34 -04:00
|
|
|
(nestlist rule30-step (uint64 0x0000000080000000) 32))
|