Created
November 12, 2011 13:50
-
-
Save MiLk/1360541 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun inverser (x) | |
(if (= x 1) 0 1) | |
) | |
(defun new-state(state pos) | |
(when (<= (length state) (+ pos 1)) (return-from new-state state)) | |
(let ((i 0)(new-list '())) | |
(dolist (arrow state new-list) | |
(if (or (= i pos) (= i (+ pos 1))) | |
(setq new-list (append new-list (list (inverser arrow)))) | |
(setq new-list (append new-list (list arrow))) | |
) | |
(setq i (+ i 1)) | |
) | |
) | |
) | |
(new-state '(0 0 0 1 0 1) 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment