Massive updates to the website

This commit is contained in:
Nathan Braswell
2020-05-12 16:22:41 -04:00
parent dac3e41101
commit c799cf485b
5 changed files with 239 additions and 80 deletions

4
bf.kp
View File

@@ -13,7 +13,9 @@
(add_grammer_rule 'bfs_atom [">"] (fn* (_) '(set-atom! cursor (+ @cursor 1))))
(add_grammer_rule 'bfs_atom ["\\+"] (fn* (_) '(set-nth! tape @cursor (+ (nth tape @cursor) 1))))
(add_grammer_rule 'bfs_atom ["-"] (fn* (_) '(set-nth! tape @cursor (- (nth tape @cursor) 1))))
(add_grammer_rule 'bfs_atom [","] (fn* (_) '(let* (value (nth input @inptr)) (do (set-atom! inptr (+ 1 @inptr)) (do (set-nth! tape @cursor value))))))
(add_grammer_rule 'bfs_atom [","] (fn* (_) '(let* (value (nth input @inptr))
(do (set-atom! inptr (+ 1 @inptr))
(set-nth! tape @cursor value)))))
(add_grammer_rule 'bfs_atom ["."] (fn* (_) '(set-atom! output (cons (nth tape @cursor) @output))))
; Define strings of BF atoms