Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Show-ASCII-table/Lua/show-ascii-table.lua
Normal file
16
Task/Show-ASCII-table/Lua/show-ascii-table.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-- map of character values to desired representation
|
||||
local chars = setmetatable({[32] = "Spc", [127] = "Del"}, {__index = function(_, k) return string.char(k) end})
|
||||
|
||||
-- row iterator
|
||||
local function iter(s,a)
|
||||
a = (a or s) + 16
|
||||
if a <= 127 then return a, chars[a] end
|
||||
end
|
||||
|
||||
-- print loop
|
||||
for i = 0, 15 do
|
||||
for j, repr in iter, i+16 do
|
||||
io.write(("%3d : %3s "):format(j, repr))
|
||||
end
|
||||
io.write"\n"
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue