This file contains 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
;; usage: ./zozotez addition.zzt or | |
;; jitbf zozotez.bf < addition.zzt or | |
;; one anonymous function to wrap all out stuff in it | |
((\() | |
;; symbols 0 to 9 to represent digits. eg. 100 is '(1 0 0) | |
(:'d2clis '(0 1 2 3 4 5 6 7 8 9)) | |
;; auxuillary function for d2c | |
(:'d2caux |
This file contains 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
[ | |
Once upon a time there were three billy goats, names Gruff. They were on their | |
way to eat on the hillside, but they had to cross a bridge. Under the bridge | |
lived a troll, with eyes as big as saucers, and a nose as long as a poker. | |
The first goat over the bridge was the youngest Billy Goat Gruff. "Trip, trap, | |
trip, trap!" he walked across the bridge. | |
"Who's that tripping over my bridge?" roared the troll. |
This file contains 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
>(-)*17>->+>->+>->[(<)*5+[(>)*7([..(+)*120(+.)*27>([-[-[-[-[-[-[-[-[(+)*8+[+[+[+ | |
[+[+[+[+[(+)*70..(+)*42(+.)*27>[-[-[-[-[-[-[-[-[(+)*8+[+[+[+[+[+[+[+[(+)*70..(+)*42( | |
+.)*27>[-[-[-[-[-[-[-[-[(+)*8+[+[+[+[+[+[+[+[(+)*70..(+)*42(+.)*27>[-[-[-[-[-[-[ | |
-[-[(+)*8+[+[+[+[+[+[+[+[(+)*70..(+)*42(+.)*27>[-[-[-[-[-[-[-[-[(+)*8+[+[+[+[+[+ | |
[+[+[(+)*70..(+)*42(+.)*27>[-[-[-[-[-[-[-[-[(+)*8+[+[+[+[+[+[+[+[(+)*70..(+)*42( | |
+.)*27>[-[-[-[-[-[-[-[-[(+)*8+[+[+[+[+[+[+[+[(+)*70..(+)*42(+.)*27>[-[-[-[-[-[-[ | |
-[-[(+)*8+[+[+[+[+[+[+[+[(+)*70..(+)*42(+.)*27>[-[-[-[-[-[-[-[-[(+)*8+[+[+[+[+[+ | |
[+[+[(+)*70..(+)*42(+.)*27>[-[-[-[-[-[-[-[-[(+)*8+[+[+[+[+[+[+[+[(+)*70..(+)*42( | |
+.)*27>[-[-[-[-[-[-[-[-[(+)*8+[+[+[+[+[+[+[+[(+)*70..(+)*42(+.)*27>[-[-[-[-[-[-[ | |
-[-[(+)*8+[+[+[+[+[+[+[+[(+)*70..(+)*42(+.)*27>[-[-[-[-[-[-[-[-[(+)*8+[+[+[+[+[+ |
This file contains 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 flatten (lst &optional backtrack acc) | |
(cond ((consp lst) (flatten (car lst) (cons (cdr lst) backtrack) acc)) | |
(lst (flatten (car backtrack) (cdr backtrack) (cons lst acc))) | |
(backtrack (flatten (car backtrack) (cdr backtrack) acc)) | |
(t (nreverse acc)))) |
This file contains 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 reverse-filter-atoms (l) | |
(funcall | |
((lambda (f) | |
((lambda (g) (funcall g g)) | |
(lambda (g) | |
(funcall f (lambda (&rest args) (apply (funcall g g) args)))))) | |
(lambda (fa) | |
(lambda (l k) | |
(if (endp l) | |
(funcall k l) |