diff options
author | elioat <elioat@tilde.institute> | 2024-06-09 18:27:26 -0400 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2024-06-09 18:27:26 -0400 |
commit | 48f7b2508802e031e883ecbdb802d19c807af0e2 (patch) | |
tree | c733dd044501e97934ff9570f2b7e852a081d7bd /lua/chupacabra/scratch.lua | |
parent | 4dee1f562de247cb202362ab276303b0dc717453 (diff) | |
download | tour-48f7b2508802e031e883ecbdb802d19c807af0e2.tar.gz |
*
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 |