diff options
Diffstat (limited to 'lua')
-rw-r--r-- | lua/chupacabra/scratch.lua | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lua/chupacabra/scratch.lua b/lua/chupacabra/scratch.lua index 204d383..4172950 100644 --- a/lua/chupacabra/scratch.lua +++ b/lua/chupacabra/scratch.lua @@ -12,11 +12,23 @@ local function table_to_string(t) return str end +local stack = {} + local function scratch(input) local output = chupacabra.run(input, {}) - print("Input: " .. input) - print("Output: " .. table_to_string(output)) + table.insert(stack, {input = input, output = output}) end +local function print_stack() + for i, entry in ipairs(stack) do + print(i .. " input: " .. entry.input) + print(" output: " .. table_to_string(entry.output)) + end +end + +scratch("3 : + [1 1 1] [2 3 4] @+ @..") +scratch("[2 4 6] 2 @..") scratch("3 : + [1 1 1] [2 3 4] @+ @..") -scratch("[2 4 6] 2 @..") \ No newline at end of file +scratch("[2 4 6] 2 @..") +scratch("1 2 3 4 5 6 7 @.. [1 2 3 0 5 6 7] @=") +print_stack() |