From 48f7b2508802e031e883ecbdb802d19c807af0e2 Mon Sep 17 00:00:00 2001 From: elioat Date: Sun, 9 Jun 2024 18:27:26 -0400 Subject: * --- lua/chupacabra/scratch.lua | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'lua/chupacabra/scratch.lua') diff --git a/lua/chupacabra/scratch.lua b/lua/chupacabra/scratch.lua index e0bab8c..204d383 100644 --- a/lua/chupacabra/scratch.lua +++ b/lua/chupacabra/scratch.lua @@ -1 +1,22 @@ -local chupacabra = require("chupacabra") \ No newline at end of file +local chupacabra = require("chupacabra") + +local function table_to_string(t) + local str = "{" + for i, v in ipairs(t) do + if i > 1 then + str = str .. ", " + end + str = str .. tostring(v) + end + str = str .. "}" + return str +end + +local function scratch(input) + local output = chupacabra.run(input, {}) + print("Input: " .. input) + print("Output: " .. table_to_string(output)) +end + +scratch("3 : + [1 1 1] [2 3 4] @+ @..") +scratch("[2 4 6] 2 @..") \ No newline at end of file -- cgit 1.4.1-2-gfad0