Hello Guys;
I finally got a working compressor..
Compresses any size file down to around 6000 bytes..
I haven't yet got the decoder done.. I was hoping for Dodicat to help me out with it..
Here's the main loop..
dim as ubyte count = 0
do
if len( bits ) mod 7 <> 0 then bits+= "0" : count+= 1 else exit do
loop
chrs = chr( count )
dim as string map = ""
dim as string s1
for a as longint = 1 to len( bits ) step 7
n1 = mid( bits , a , 7 )
n1 = "1" + n1
n1 = oct( val( "&B" + n1 ) )
if n1[1] = 48 then
if n1[0] = 50 then map+= "0"
if n1[0] = 51 then map+= "1"
n1 = mid( n1 , 3 )
else
if n1[0] = 50 then n1 = mid( n1 , 2 )
if n1[0] = 51 then n1 = mid( n1 , 2 ) : n1[1]+= 8 : s1 = hex( n1[1] - 48 ) : n1[1] = s1[0] : n1 = ltrim( n1 , "7" )
end if
chrs+= chr( val( "&H" + n1 ) )
next
bits = ""
chrs+= "END"
for a as longint = 1 to len( map ) step 8
chrs+= chr( val( "&B" + mid( map , a , 8 ) ) )
next
loops+=1
chrs = Zlibrary.pack( chrs )
Keep looping til it can't get any smaller..
Can you guys un-ban me from the forum..