Thue-Morse: Difference between revisions
Content deleted Content added
Line 306: | Line 306: | ||
=={{header|NewLISP}}== |
=={{header|NewLISP}}== |
||
<lang newslisp> |
<lang newslisp>(define (Thue-Morse loops) |
||
(define (Thue-Morse loops) |
|||
(setf TM '(0)) |
(setf TM '(0)) |
||
(println TM) |
(println TM) |
||
(for (i 1 (-- loops)) |
(for (i 1 (-- loops)) |
||
(setf |
(setf tmp TM) |
||
(replace '0 |
(replace '0 tmp '_) |
||
(replace '1 |
(replace '1 tmp '0) |
||
(replace '_ |
(replace '_ tmp '1) |
||
(setf TM (append TM |
(setf TM (append TM tmp)) |
||
(println TM) |
(println TM) |
||
) |
) |
||
Line 323: | Line 322: | ||
(exit) |
(exit) |
||
</lang> |
</lang> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
(0) |
(0) |