diff options
Diffstat (limited to 'lua/chupacabra/scratch.lua')
-rw-r--r-- | lua/chupacabra/scratch.lua | 23 |
1 files changed, 22 insertions, 1 deletions
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 |