Merge pull request #29 from DuckNoodleSoup/master

Changed :output to :print
This commit is contained in:
Lee Spector 2021-07-19 17:41:43 -04:00 committed by GitHub
commit 890c2de152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 11 deletions

View File

@ -71,9 +71,9 @@
program
(assoc state/empty-state :input {:in1 (first input)
:in2 (last input)}
:output '(""))
:print '(""))
(:step-limit argmap))
:output))
:print))
inputs)
parsed-outputs (map (fn [output]
(try (read-string output)

View File

@ -75,9 +75,9 @@
:in2 (get input 1)
:in3 (get input 2)
:in4 (get input 3)}
:output '(""))
:print '(""))
(:step-limit argmap))
:output))
:print))
inputs)
errors (map (fn [correct-output output]
(let [parsed-output (try (read-string output)

View File

@ -31,9 +31,9 @@
:print_newline
^{:stacks [:print]}
(fn [state]
(let [current-output (state/peek-stack state :output)
popped-state (state/pop-stack state :output)]
(state/push-to-stack popped-state :output (str current-output \newline)))))
(let [current-output (state/peek-stack state :print)
popped-state (state/pop-stack state :print)]
(state/push-to-stack popped-state :print (str current-output \newline)))))
(def _print
^{:stacks [:print]
@ -46,10 +46,10 @@
(char? top-item))
top-item
(pr-str top-item))
current-output (state/peek-stack state :output)
popped-state (state/pop-stack (state/pop-stack state stack) :output)]
current-output (state/peek-stack state :print)
popped-state (state/pop-stack (state/pop-stack state stack) :print)]
(state/push-to-stack popped-state
:output
:print
(str current-output top-item-str))))))
(generate-instructions

View File

@ -7,8 +7,9 @@
:exec '()
:float '()
:input {}
:output {}
:integer '()
:output '("")
:print '("")
:string '()
:vector_boolean '()
:vector_float '()