It's for a data compressor... The code is FreeBasic.. ( freebasic.net )
if n1 = 110 or 111 it compresses a bit..
if n1 = 000 or 001 it expands 2 bits..
it compresses a bit more often than it expands 2 bits, so it overall it compresses..
n1 = 3 bits
if n1 = "000" then outs+= "0" : map+= "1101"
if n1 = "001" then outs+= "1" : map+= "1101"
if n1 = "010" then outs+= "0" : map+= "11"
if n1 = "011" then outs+= "1" : map+= "11"
if n1 = "100" then outs+= "0" : map+= "10"
if n1 = "101" then outs+= "1" : map+= "10"
if n1 = "110" then outs+= "0" : map+= "0"
if n1 = "111" then outs+= "1" : map+= "0"
Got to figure out a bit sequence for the "1101" it neds to be a sequence that the other 3 outputs can't equal out to..
You turn the "outs" and "map" into output chars..
And then pass the output to a zip lib, and then repeat , until the output is bigger than or equla to the input...
What I have tried:
played around with different sequences...
0101
etc...