LZW compression: Difference between revisions

m
m (added </lang> tag in Fortran entry to restore FreeBASIC entry)
Line 3,313:
 
=={{header|Lua}}==
 
{{incorrect|Lua|Requires Lua 5.1+ based on syntax, yet none of Lua 5.1 - 5.4 will produce correct output: value of dec from decompress() is nil, second line of printed output is "nil". Result for this specific test case can be corrected by altering initial value of dictSize to 256 (from 255 in compress; from 0 in decompress), though it is unclear/untested if remainder of the dictionary maintenance code would be entirely functional as-is for the general case.}}
 
<lang lua>local function compress(uncompressed) -- string
local dictionary, result, dictSize, w, c = {}, {}, 255, ""
Anonymous user