A few more evolved FizzBuzz Push programs
Draft of 2018.02.20
May include: genetic programming ↘ &c.
I’ve said in earlier episodes that I’ve been successfully evolving algorithms that “do” FizzBuzz, using Lee Spector’s Clojush. I wanted to record and walk through a few more of the programs that arose, just to explore the “design patterns” that Clojush tends to uncover in the Push language it implements.
I’m hoping to use one of the other off-the-shelf genetic programming projects out there (possibly PonyGE2, which uses Grammatical Evolution) to do the same thing. We’ll see how that works another time, but I am curious to see what the Python code it “discovers” will be like, in comparison to Push code.
How I’m doing this
I’m starting from the instructions posted at the Clojush repository’s wiki, but of course things could be made a lot easier.
So here’s what I’ve set up in my REPL, which is honestly weird because why wouldn’t this already be a thing included in the Clojush distribution?
(use 'clojush.pushstate) (use 'clojush.interpreter) (use 'clojush.args) (defn trace-push [program args-vector steps] (let [start-state (reduce (fn [p i] (push-item i :input p)) (make-push-state) args-vector)] (reset-globals {:evalpush-limit steps}) (run-push program start-state true) ))
This function trace-push
does all the work of setting up a new Push interpreter thing, pushes all the items in the collection args-vector
onto the :input
stack (in that order), and runs the program with the specified :evalpush-limit
. This way, I can type a single line to trace a given program with a particular input, and it will poop out all this state information for me to edit later:
clojush.core=> (trace-push '(2 3 integer_mult 4 5 integer_sub) [17] 100) State after 0 steps: :exec = ((2 3 integer_mult 4 5 integer_sub)) :code = nil :integer = nil :float = nil :boolean = nil :char = nil :string = nil :zip = nil :vector_integer = nil :vector_float = nil :vector_boolean = nil :vector_string = nil :input = (17) :output = nil :auxiliary = nil :tag = nil :return = nil :environment = nil :genome = nil State after 1 steps (last step: (...)): :exec = (2 3 integer_mult 4 5 integer_sub) :code = nil :integer = nil :float = nil :boolean = nil :char = nil :string = nil :zip = nil :vector_integer = nil :vector_float = nil :vector_boolean = nil :vector_string = nil :input = (17) :output = nil :auxiliary = nil :tag = nil :return = nil :environment = nil :genome = nil State after 2 steps (last step: 2): :exec = (3 integer_mult 4 5 integer_sub) :code = nil :integer = (2) :float = nil :boolean = nil :char = nil :string = nil :zip = nil :vector_integer = nil :vector_float = nil :vector_boolean = nil :vector_string = nil :input = (17) :output = nil :auxiliary = nil :tag = nil :return = nil :environment = nil :genome = nil State after 3 steps (last step: 3): :exec = (integer_mult 4 5 integer_sub) :code = nil :integer = (3 2) :float = nil :boolean = nil :char = nil :string = nil :zip = nil :vector_integer = nil :vector_float = nil :vector_boolean = nil :vector_string = nil :input = (17) :output = nil :auxiliary = nil :tag = nil :return = nil :environment = nil :genome = nil State after 4 steps (last step: integer_mult): :exec = (4 5 integer_sub) :code = nil :integer = (6) :float = nil :boolean = nil :char = nil :string = nil :zip = nil :vector_integer = nil :vector_float = nil :vector_boolean = nil :vector_string = nil :input = (17) :output = nil :auxiliary = nil :tag = nil :return = nil :environment = nil :genome = nil State after 5 steps (last step: 4): :exec = (5 integer_sub) :code = nil :integer = (4 6) :float = nil :boolean = nil :char = nil :string = nil :zip = nil :vector_integer = nil :vector_float = nil :vector_boolean = nil :vector_string = nil :input = (17) :output = nil :auxiliary = nil :tag = nil :return = nil :environment = nil :genome = nil State after 6 steps (last step: 5): :exec = (integer_sub) :code = nil :integer = (5 4 6) :float = nil :boolean = nil :char = nil :string = nil :zip = nil :vector_integer = nil :vector_float = nil :vector_boolean = nil :vector_string = nil :input = (17) :output = nil :auxiliary = nil :tag = nil :return = nil :environment = nil :genome = nil State after 7 steps (last step: integer_sub): :exec = () :code = nil :integer = (-1 6) :float = nil :boolean = nil :char = nil :string = nil :zip = nil :vector_integer = nil :vector_float = nil :vector_boolean = nil :vector_string = nil :input = (17) :output = nil :auxiliary = nil :tag = nil :return = nil :environment = nil :genome = nil #clojush.pushstate.PushState{:exec (), :code nil, :integer (-1 6), :float nil, :boolean nil, :char nil, :string nil, :zip nil, :vector_integer nil, :vector_float nil, :vector_boolean nil, :vector_string nil, :input (17), :output nil, :auxiliary nil, :tag nil, :return nil, :environment nil, :genome nil, :termination :normal} clojush.core=>
As I mentioned in earlier Push traces, I’m editing out the superfluous information by hand, and also adding annotations in each step to help explain what’s going on. So don’t worry, I hope it won’t be this messy or opaque for the real programs.
Revisiting “The Finger Counter”
This is actually a program I’ve already discussed, which I started to call “the Finger Counter” when I started to take a look into its dynamics. I’m not certain I really know how it works, at this writing, just that it seems to have a remarkably high computational complexity. So I want to go back and walk through it for all four input conditions: argument is divisible by 15
, divisible by 3
, divisible by 5
and not divisible by 3
or 5
.
;; "fingers" (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)))))
Let me start this time with an input of 14
:
clojush.core=> (trace-push fingers [14] 1000) | |
State after 0 steps: | |
;; program pushed to :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 = (14) | |
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 = (14) | |
State after 2 steps (last step: in1): | |
;; input is 14 | |
: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 = (14) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (14) | |
State after 3 steps (last step: exec_do*while): | |
;; 'exec_do*while pops the top :exec item and then pushes | |
;; 1. 'exec_while | |
;; 2. the top item from :exec | |
;; | |
;; here, our "top item" on :exec is the code block | |
;; '(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)))) | |
;; so the :exec stack gets bigger right here! | |
;; | |
: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 = (14) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (14) | |
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 = (14) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (14) | |
State after 5 steps (last step: exec_do*count): | |
;; 'exec_do*count _also_ pushes a complex code block to :exec (see that stack) | |
;; it uses the top :integer to set up a counter | |
:exec = ((0 13 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 = (14) | |
State after 6 steps (last step: (...)): | |
;; unwrap code block | |
:exec = (0 13 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 = (14) | |
State after 7 steps (last step: 0): | |
;; push counter 0 | |
:exec = (13 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 = (14) | |
State after 8 steps (last step: 13): | |
;; push counter limit 13 | |
: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 = (13 0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (14) | |
State after 9 steps (last step: exec_do*range): | |
;; 'exec_do*range pushes a complex code block to :exec (see that stack) | |
: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 13 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 = (14) | |
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 13 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 = (14) | |
State after 11 steps (last step: exec_do*count): | |
;; more looping | |
: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 13 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 = (14) | |
State after 12 steps (last step: (...)): | |
;; another 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 13 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 = (14) | |
State after 13 steps (last step: in1): | |
;; the input is 14 | |
: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 13 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 = (14 0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (14) | |
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 13 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 = (14 0) | |
:boolean = nil | |
:char = nil | |
:string = ("buzz") | |
:input = (14) | |
State after 15 steps (last step: exec_yankdup): | |
;; pull a copy of the item at position 14 in :exec to the top | |
:exec = ((integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) 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 13 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 = (14) | |
State after 16 steps (last step: (...)): | |
;; unwrap code block | |
:exec = (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush) 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 13 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 = (14) | |
State after 17 steps (last step: integer_lte): | |
;; missing arguments, does nothing | |
:exec = (exec_while ("fizz" "buzz" string_concat exec_flush) 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 13 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 = (14) | |
State after 18 steps (last step: exec_while): | |
;; missing arguments (it wants a :boolean) | |
: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 13 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 = (14) | |
State after 19 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 13 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 = (14) | |
State after 20 steps (last step: exec_when): | |
;; mising argument (wants a :boolean) | |
: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 13 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 = (14) | |
State after 21 steps (last step: fizz): | |
;; string "fizz" | |
: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 13 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" "buzz") | |
:input = (14) | |
State after 22 steps (last step: string_take): | |
;; pops an :integer (0) and top :string ("fizz"), and returns (take 0 "fizz") = "" | |
: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 13 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 = ("" "buzz") | |
:input = (14) | |
State after 23 steps (last step: integer_yankdup): | |
;; missing arguments | |
: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 13 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 = ("" "buzz") | |
:input = (14) | |
State after 24 steps (last step: boolean_frominteger): | |
;; missing arguments | |
: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 13 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 = ("" "buzz") | |
:input = (14) | |
State after 25 steps (last step: string_take): | |
;; missing arguments | |
: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 13 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 = ("" "buzz") | |
:input = (14) | |
State after 26 steps (last step: string_dup): | |
;; duplicate top :string item | |
: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 13 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 = ("" "" "buzz") | |
:input = (14) | |
State after 27 steps (last step: integer_stackdepth): | |
;; count items in :integer stack | |
:exec = (exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 13 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 = (14) | |
State after 28 steps (last step: exec_yankdup): | |
;; push a copy of the 0th item on :exec stack... | |
:exec = (exec_y exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 13 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 = ("" "" "buzz") | |
:input = (14) | |
State after 29 steps (last step: exec_y): | |
;; goodbye! we will loop forever | |
:exec = (exec_y (exec_y exec_y) integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 13 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 = ("" "" "buzz") | |
:input = (14) |
And you know what? I have no damned idea how this works. I mean, I see it looping and stuff, but I can’t follow this example at all.
Let me try with an argument that is divisible by 3
(so how about 3
itself?):
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) |
It’s a real head-scratcher. But then, finally, I see where there’s a divergence in the two runs, at the 16th step. There is a call to 'exec_yankdup
, and that is using a value that changes depending on the input argument (the value is actually, at this point, (i−1) for some argument i).
The 'x_yankdup
combinator instruction, in Push languages, pops an :integer
argument. It looks at the :x
stack (for some :x
, so :exec_yankdup
looks at :exec
), and it makes a duplicate of the item in that stack it finds at the indicated position (in zero-based notation, because Clojure). If the integer is 0 or less, it will return the top item; up to the length of the stack, it will pick that indexed item; for larger numbers, it will pick the last item.
So this is where we see our branching logic in “Fingers”. For an input of 15
, we push a copy of the item on the :exec
stack indexed by 14
, which is the code block '(integer_lte exec_while ("fizz" "buzz" string_concat exec_flush))
. For an input of 3
, we push a copy of the item found in the 2nd position, which is a 'string_take
instruction. These two new different-sized :exec
items change the length of the :exec
stack in each case, so from here on the dynamics diverge in time somewhat as well.
What happens further along, it seems, is that with input 14
, at step 21 we end up with :string = ("fizz" "buzz")
, and the very next instruction is that string_take
we didn’t duplicate earlier, producing the stack :string = ("" "buzz")
, which persists through the remainder of the trace.
On the other hand, with input 3
, the duplicated string_take
instruction has erased the one string on the stack, but it has also consumed our one :integer
. So now we enter a series of instructions that need :integer
arguments, but lack them and therefore fail. Finally, in the 19th step, we obtain the stack :string = ("fizz" "")
. Later, in the 24th step, we actually duplicate the top "fizz"
, but for no apparent reason.
To be honest, it’s not clear how this could work for an argument that is a multiple of 3
. That is, we duplicated a particular item onto the :exec
stack with input 3
, and that depended on the input. If I try 6
what happens?
clojush.core=> (trace-push fingers [6] 1000) | |
State after 0 steps: | |
;; the program | |
: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 = (6) | |
State after 1 steps (last step: (...)): | |
;; unwrap the program | |
: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 = (6) | |
State after 2 steps (last step: in1): | |
;; the input is 6 | |
: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 = (6) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (6) | |
State after 3 steps (last step: exec_do*while): | |
;; set up the complicated loop 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 = (6) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (6) | |
State after 4 steps (last step: (...)): | |
;; unwrap a 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 = (6) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (6) | |
State after 5 steps (last step: exec_do*count): | |
;; count from 0 to 5 | |
:exec = ((0 5 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 = (6) | |
State after 6 steps (last step: (...)): | |
;; unwrap code block | |
:exec = (0 5 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 = (6) | |
State after 7 steps (last step: 0): | |
;; 0 counter | |
:exec = (5 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 = (6) | |
State after 8 steps (last step: 5): | |
;; 5 counter | |
: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 = (5 0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (6) | |
State after 9 steps (last step: exec_do*range): | |
;; do the thing, then loop from 1 to 5 next time | |
: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 5 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 = (6) | |
State after 10 steps (last step: (...)): | |
;; unwrap the 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 5 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 = (6) | |
State after 11 steps (last step: exec_do*count): | |
;; do this once | |
: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 5 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 = (6) | |
State after 12 steps (last step: (...)): | |
;; codde 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 5 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 = (6) | |
State after 13 steps (last step: in1): | |
;; input is 6 | |
: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 5 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 = (6 0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (6) | |
State after 14 steps (last step: buzz): | |
;; 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 5 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 = (6 0) | |
:boolean = nil | |
:char = nil | |
:string = ("buzz") | |
:input = (6) | |
State after 15 steps (last step: exec_yankdup): | |
;; copy the 6th item... which is string_take | |
: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 5 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 = (6) | |
State after 16 steps (last step: string_take): | |
: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 5 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 = (6) | |
State after 17 steps (last step: integer_div): | |
: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 5 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 = (6) | |
State after 18 steps (last step: exec_when): | |
: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 5 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 = (6) | |
State after 19 steps (last step: fizz): | |
: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 5 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 = (6) | |
State after 20 steps (last step: string_take): | |
: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 5 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 = (6) | |
State after 21 steps (last step: integer_yankdup): | |
: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 5 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 = (6) | |
State after 22 steps (last step: boolean_frominteger): | |
: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 5 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 = (6) | |
State after 23 steps (last step: string_take): | |
: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 5 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 = (6) | |
State after 24 steps (last step: string_dup): | |
: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 5 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 = (6) | |
State after 25 steps (last step: integer_stackdepth): | |
:exec = (exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 5 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 = (6) | |
State after 26 steps (last step: exec_yankdup): | |
:exec = (exec_y exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) (1 5 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 = (6) |
That’s odd. I haven’t finished annotating this one, because it appears to the same things along the way as the case with input 3
. So what’s different, and how does that…?
Here’s what’s happens with an input of 33
:
clojush.core=> (trace-push fingers [33] 1000) | |
State after 0 steps: | |
: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 = (33) | |
State after 1 steps (last step: (...)): | |
: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 = (33) | |
State after 2 steps (last step: in1): | |
: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 = (33) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (33) | |
State after 3 steps (last step: exec_do*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 = (33) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (33) | |
State after 4 steps (last step: (...)): | |
: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 = (33) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (33) | |
State after 5 steps (last step: exec_do*count): | |
:exec = ((0 32 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 = (33) | |
State after 6 steps (last step: (...)): | |
:exec = (0 32 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 = (33) | |
State after 7 steps (last step: 0): | |
:exec = (32 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 = (33) | |
State after 8 steps (last step: 32): | |
: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 = (32 0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (33) | |
State after 9 steps (last step: exec_do*range): | |
: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 32 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 = (33) | |
State after 10 steps (last step: (...)): | |
: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 32 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 = (33) | |
State after 11 steps (last step: exec_do*count): | |
: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 32 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 = (33) | |
State after 12 steps (last step: (...)): | |
: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 32 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 = (33) | |
State after 13 steps (last step: in1): | |
: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 32 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 = (33 0) | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (33) | |
State after 14 steps (last step: 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 32 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 = (33 0) | |
:boolean = nil | |
:char = nil | |
:string = ("buzz") | |
:input = (33) | |
State after 15 steps (last step: exec_yankdup): | |
: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)))) 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 32 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 = (33) | |
State after 16 steps (last step: (...)): | |
: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))) 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 32 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 = (33) | |
State after 17 steps (last step: exec_do*count): | |
: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))) 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 32 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 = (33) | |
State after 18 steps (last step: (...)): | |
: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)) 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 32 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 = (33) | |
State after 19 steps (last step: exec_do*count): | |
: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)) 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 32 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 = (33) | |
State after 20 steps (last step: (...)): | |
: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)) 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 32 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 = (33) | |
State after 21 steps (last step: in1): | |
: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)) 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 32 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 = (33 0) | |
:boolean = nil | |
:char = nil | |
:string = ("buzz") | |
:input = (33) | |
State after 22 steps (last step: 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)) 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 32 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 = (33 0) | |
:boolean = nil | |
:char = nil | |
:string = ("buzz" "buzz") | |
:input = (33) | |
State after 23 steps (last step: exec_yankdup): | |
: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)))) 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)) 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 32 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" "buzz") | |
:input = (33) | |
State after 24 steps (last step: (...)): | |
: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))) 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)) 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 32 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" "buzz") | |
:input = (33) | |
State after 25 steps (last step: exec_do*count): | |
: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))) 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)) 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 32 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" "buzz") | |
:input = (33) | |
State after 26 steps (last step: (...)): | |
: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)) 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)) 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 32 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" "buzz") | |
:input = (33) | |
State after 27 steps (last step: exec_do*count): | |
: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)) 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)) 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 32 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" "buzz") | |
:input = (33) | |
State after 28 steps (last step: (...)): | |
: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)) 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)) 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 32 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" "buzz") | |
:input = (33) | |
State after 29 steps (last step: in1): | |
: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)) 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)) 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 32 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 = (33 0) | |
:boolean = nil | |
:char = nil | |
:string = ("buzz" "buzz") | |
:input = (33) | |
State after 30 steps (last step: 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)) 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)) 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 32 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 = (33 0) | |
:boolean = nil | |
:char = nil | |
:string = ("buzz" "buzz" "buzz") | |
:input = (33) | |
State after 31 steps (last step: exec_yankdup): | |
: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)) 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)) 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 32 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" "buzz" "buzz") | |
:input = (33) | |
State after 32 steps (last step: string_take): | |
: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)) 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)) 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 32 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 = ("" "buzz" "buzz") | |
:input = (33) | |
State after 33 steps (last step: integer_div): | |
: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)) 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)) 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 32 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 = ("" "buzz" "buzz") | |
:input = (33) | |
State after 34 steps (last step: exec_when): | |
: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)) 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)) 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 32 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 = ("" "buzz" "buzz") | |
:input = (33) | |
State after 35 steps (last step: fizz): | |
: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)) 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)) 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 32 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" "" "buzz" "buzz") | |
:input = (33) | |
State after 36 steps (last step: string_take): | |
: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)) 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)) 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 32 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" "" "buzz" "buzz") | |
:input = (33) | |
State after 37 steps (last step: integer_yankdup): | |
: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)) 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)) 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 32 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" "" "buzz" "buzz") | |
:input = (33) | |
State after 38 steps (last step: boolean_frominteger): | |
: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)) 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)) 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 32 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" "" "buzz" "buzz") | |
:input = (33) | |
State after 39 steps (last step: string_take): | |
: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)) 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)) 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 32 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" "" "buzz" "buzz") | |
:input = (33) | |
State after 40 steps (last step: string_dup): | |
:exec = (integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) 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)) 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 32 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" "" "buzz" "buzz") | |
:input = (33) | |
State after 41 steps (last step: integer_stackdepth): | |
:exec = (exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) 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)) 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 32 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" "" "buzz" "buzz") | |
:input = (33) | |
State after 42 steps (last step: exec_yankdup): | |
:exec = (exec_y exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) 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)) 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 32 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" "" "buzz" "buzz") | |
:input = (33) | |
State after 43 steps (last step: exec_y): | |
:exec = (exec_y (exec_y exec_y) integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)) 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)) 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 32 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" "" "buzz" "buzz") | |
:input = (33) |
Notice that this one doesn’t enter the infinite loop until step 43, and when it does, its :string
stack is :string = ("fizz" "fizz" "" "buzz" "buzz")
. That’s quite a bit different from the earlier 3-divisible cases, where we entered the infinite loop at step 26, with a stack :string = ("fizz" "fizz" "")
, in both cases.
This is so confusing.
I try a few different 3-divisible inputs, and look to see (1) when the infinite loop starts, and (2) what the :string
stack looks like.
input first exec_y string stack ----- ------------ ------------ 3 27 ["fizz" "fizz" ""] 6 27 ["fizz" "fizz" ""] 9 28 * ["fizz" "fizz" "buzz"] 12 27 ["fizz" "fizz" ""] 18 35 ["fizz" "fizz" "" "buzz"] 21 35 ["fizz" "fizz" "" "buzz"] 24 36 * ["fizz" "fizz" "buzz" "buzz"] 27 35 ["fizz" "fizz" "" "buzz"] 33 43 ["fizz" "fizz" "" "buzz" "buzz"] 36 43 ["fizz" "fizz" "" "buzz" "buzz"] 39 44 * ["fizz" "fizz" "buzz" "buzz" "buzz"] 42 43 ["fizz" "fizz" "" "buzz" "buzz"] 48 51 ["fizz" "fizz" "" "buzz" "buzz" "buzz"] 51 51 ["fizz" "fizz" "" "buzz" "buzz" "buzz"] 54 52 * ["fizz" "fizz" "buzz" "buzz" "buzz" "buzz"] 57 51 ["fizz" "fizz" "" "buzz" "buzz" "buzz"] 63 59 ["fizz" "fizz" "" "buzz" "buzz" "buzz" "buzz"] 69 60 * ["fizz" "fizz" "buzz" "buzz" "buzz" "buzz" "buzz"] 111 83 ["fizz" "fizz" "" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz"] 222 139 ["fizz" "fizz" "" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz"] 333 203 ["fizz" "fizz" "" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz"] 336 203 ["fizz" "fizz" "" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz"] 339 225 * ["fizz" "fizz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz"] 342 203 ["fizz" "fizz" "" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz" "buzz"]
My head hurts.
OK, so it seems as if there are actually two different branches handling “divisible by 3
not 5
”. In one, which applies when the argument is i∈{3,6,12,18,21,27,33,36,42,…}, there ends up being an empty string between the two copies of "fizz"
, and a monotonically-increasing series of "buzz"
. In the other, which applies when the argument is i∈{9,24,39,54,69,…}, the stacks don’t contain an empty string.
Those numbers don’t seem familiar. But looking up [9,24,39,54,69]
in the OEIS produces, “Numbers that are the sum of 9 nonzero 4th powers.”
What the actual fuck?
You’ll notice that at the end of the table above, I considered inputs of 333
, 336
, 339
and 342
. That’s because I’d looked at 333
(one of those numbers you type into a program when you want “a bunch not a lot”), and once I saw the OEIS series I tested to see if the next element larger than 333
would share that not-deleted-central-“buzz” feature. And yes, it does, and the adjacent divisible-by-3 values do not.
Seriously: what?
I will have to come back to to this another day. More infrastructure is called for, if I’m to actually understand what’s happening here. For example, as I watch the traces scroll by on the terminal window, I notice that the :exec
stack grows and then shrinks again. Obviously something is happening that makes copies of something (possibly the way the Push loops unroll?), and then as those get executed we consume items until we’re down to the 'exec_y
milestone I’ve arbitrarily picked.
But… what?
Just what is it that you’re doing, Fingers?