Created
February 20, 2018 15:18
-
-
Save Vaguery/0b02016a92df4ed49b10757a3c5e2145 to your computer and use it in GitHub Desktop.
Walking through the FizzBuzz program "fingers" with input = 3
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
clojush.core=> (trace-push fingers [3] 1000) | |
State after 0 steps: | |
;; program on :exec | |
:exec = ((in1 exec_do*while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))))) | |
:code = nil | |
:integer = nil | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 1 steps (last step: (...)): | |
;; unwrap code block | |
:exec = (in1 exec_do*while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = nil | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 2 steps (last step: in1): | |
;; input is 3 | |
:exec = (exec_do*while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (3) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 3 steps (last step: exec_do*while): | |
;; pushes a copy of the top :exec item then 'exec_while | |
:exec = ((exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (3) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 4 steps (last step: (...)): | |
;; unwrap code block | |
:exec = (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (3) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 5 steps (last step: exec_do*count): | |
;; counters 0 2 and 'exec_do*range pushed to :exec, followed by the top item (still a code block) | |
:exec = ((0 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 6 steps (last step: (...)): | |
;; unwrap a code block | |
:exec = (0 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 7 steps (last step: 0): | |
;; 0 | |
:exec = (2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 8 steps (last step: 2): | |
;; 2 | |
:exec = (exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (2 0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 9 steps (last step: exec_do*range): | |
;; it this pushes the item being looped (it's still a code block), then the counters 1 and 2, and the item again (it will loop until the counters zero out) | |
;; | |
:exec = ((exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 10 steps (last step: (...)): | |
;; unwrap code block | |
:exec = (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 11 steps (last step: exec_do*count): | |
;; we're going to do this one time and quit (counter is 0) | |
:exec = ((in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 12 steps (last step: (...)): | |
;; unwrap code block | |
:exec = (in1 "buzz" exec_yankdup integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 13 steps (last step: in1): | |
;; input is 3 | |
:exec = ("buzz" exec_yankdup integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (3 0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (3) | |
State after 14 steps (last step: buzz): | |
;; string literal "buzz" | |
:exec = (exec_yankdup integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (3 0) | |
:boolean = nil | |
:char = nil | |
:string = ("buzz") | |
:input = (3) | |
State after 15 steps (last step: exec_yankdup): | |
push a copy of the item in position 3 on :exec | |
:exec = (string_take integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (0) | |
:boolean = nil | |
:char = nil | |
:string = ("buzz") | |
:input = (3) | |
State after 16 steps (last step: string_take): | |
;; we take 0 chars from `"buzz"` = `""` | |
:exec = (integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = ("") | |
:input = (3) | |
State after 17 steps (last step: integer_div): | |
;; missing arguments | |
:exec = (exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = ("") | |
:input = (3) | |
State after 18 steps (last step: exec_when): | |
;; missing :boolean argument | |
:exec = ("fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = ("") | |
:input = (3) | |
State after 19 steps (last step: fizz): | |
;; string literal | |
:exec = (string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = ("fizz" "") | |
:input = (3) | |
State after 20 steps (last step: string_take): | |
;; missing argument | |
:exec = (integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = ("fizz" "") | |
:input = (3) | |
State after 21 steps (last step: integer_yankdup): | |
;; missing argument | |
:exec = (boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = ("fizz" "") | |
:input = (3) | |
State after 22 steps (last step: boolean_frominteger): | |
;; missing argument | |
:exec = (string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = ("fizz" "") | |
:input = (3) | |
State after 23 steps (last step: string_take): | |
;; missing argument | |
:exec = (string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = ("fizz" "") | |
:input = (3) | |
State after 24 steps (last step: string_dup): | |
;; duplicates `"fizz"` | |
:exec = (integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = ("fizz" "fizz" "") | |
:input = (3) | |
State after 25 steps (last step: integer_stackdepth): | |
;; produces 0 | |
:exec = (exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = (0) | |
:boolean = nil | |
:char = nil | |
:string = ("fizz" "fizz" "") | |
:input = (3) | |
State after 26 steps (last step: exec_yankdup): | |
;; we start looping forever... | |
:exec = (exec_y exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 2 exec_do*range (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))) exec_while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))))) | |
:code = nil | |
:integer = () | |
:boolean = nil | |
:char = nil | |
:string = ("fizz" "fizz" "") | |
:input = (3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment