'one time run , create initial string if loops = 1 then For n As Long = 1 To 10000 s+=chr(Int(Rnd*256))'+48) Next compare = s length = len(s) else 'modify compression to make further compression possible

dim as string outputs="" dim as ubyte n1 , n2 for a as longint = 0 to len(chrs)-1 step 1

n1 = chrs[a] n2 = chrs[a]

n1*= 64

if n1 = 0 then outputs+="0" if n1 = 64 then outputs+="1" if n1 = 128 then outputs+="2" if n1 = 192 then outputs+="3"

outputs+=right("00"+str(n2\(256\64)),2)

next

dim as string final_out="" for a as longint = 1 to len(outputs) step 3 final_out+=chr(val("&O"+mid(outputs,a,3))) next

return final_out

end function'==============================================================================='============================================================================Function decompress_loop( chrs as string ) as string

dim as string outputs="" dim as ubyte n1 , n2 for a as longint = 0 to len(chrs)-1 step 1

n1 = chrs[a] n2 = chrs[a]

n1*= 64

if n1 = 0 then outputs+="0" if n1 = 64 then outputs+="1" if n1 = 128 then outputs+="2" if n1 = 192 then outputs+="3"

outputs+=right("00"+str(n2\(256\64)),2) ' 0 to 63 , the highest is 363 which is less and then (oct 377 = 255).

next

print "c out = " ; len(outputs) , outputs

dim as string final_out="" for a as longint = 1 to len(outputs) step 3 final_out+=chr(val("&O"+mid(outputs,a,3))) ' using oct , converts the last 2 digits to oct , how to reverse it ? next

return final_out

end function'==============================================================================='============================================================================Function decompress_loop( chrs as string ) as string

'one time run , create initial string if loops = 1 then For n As Long = 1 To 10000 s+=chr(Int(Rnd*256))'+48) Next compare = s length = len(s) else 'modify compression to make further compression possible

end function'==============================================================================='============================================================================Function decompress_loop( chrs as string ) as string

function compress(byval s as string) as string dim as string start=chr(s[0]) for i as long=1 to len(s)-1 var t=str(s[i]-s[i-1]) if instr(t,"-")=0 then t="+"+t start=start+t next i return start end function

function decompress(byval s as string) as string dim as string start=chr(s[0]) dim as long k s=ltrim(s,chr(s[0])) for i as long=1 to len(s)-1 var t=valint(s) if t<0 then k=1 else k=2 var L=len(str(t))+k s=mid(s,L) start+=chr(start[i-1]+t) if s="" then exit for next i return start end function

Using less than 256 chars in a string ,almost always compresses....It's when you use all 256 chars it doesn't compress..

I'm trying to compress a string that has all 256 chars in it..

========================================================================I though of an idea!!

On screen 19 you can plot 100 digits..

You print out the number , and start at a distance , and draw lines to the different numbers.Lines to all the 0's , 1's , 2's ,,,, 9's , And use ten trig formulas , to draw the lines to the numbers...Or record the angles to the numbers

The 10 trig formulas might be less than 100 bytes. You can skip one number ; maybe zero...=======================================================================

'one time run , create initial string if loops = 1 then For n As Long = 1 To 10000 s+=chr(Int(Rnd*256))'+48) Next compare = s length = len(s) else 'modify compression to make further compression possible

dim as string outputs="" dim as string num for a as longint = 1 to len(outs1) step 1

num = bin(val(mid(outs1,a,1)))

dim as longint count = 0 for b as longint = 0 to len(num)-1 step 1

if num[b] = 48 then outputs+=str(len(num)-b) : count = 1

next

if count = 0 then outputs+= "~"

next

return outputs

end function'==============================================================================='============================================================================Function decompress_loop( chrs as string ) as string

dim as string outputs="" dim as string num for a as longint = 1 to len(outs1) step 1

num = bin(val(mid(outs1,a,1)))

dim as longint count = 0 for b as longint = 0 to len(num)-1 step 1

if num[b] = 48 then outputs+=str(len(num)-b) : count = 1

next

if count = 0 then outputs+= "~"

next

print "c inp = " ; bin(valulng(outs1)) print "c out = " ; outputs

return outputs

end function'==============================================================================='============================================================================Function decompress_loop( chrs as string ) as string

'one time run , create initial string if loops = 1 then For n As Long = 1 To 10000 s+=chr(Int(Rnd*256))'+48) Next compare = s length = len(s) else 'modify compression to make further compression possible

dim as string final="" for a as longint = 1 to len(outputs) step 8 final+=chr(val("&B"+mid(outputs,a,8))) next

return final

end function'==============================================================================='============================================================================Function decompress_loop( chrs as string ) as string

'one time run , create initial string if loops = 1 then For n As Long = 1 To 10000 s+=chr(Int(Rnd*256))'+48) Next compare = s length = len(s) else 'modify compression to make further compression possible

dim as string outputs="" dim as string num for a as longint = 1 to len(outs1) step 3

num = mid(outs1,a,3)

if num = "000" then outputs+="11" ' all 0's if num = "001" then outputs+="00" ' bit 1 set if num = "010" then outputs+="01" 'bit2 set if num = "011" then outputs+="0100" ' bits 2 and 1 set if num = "100" then outputs+="10" ' bit 3 set if num = "101" then outputs+="1000" ' bits 3 and 1 set if num = "110" then outputs+="1001" ' bits 3 and 2 set if num = "111" then outputs+="100100" ' bits 3 2 1 set

next

dim as string final="" for a as longint = 1 to len(outputs) step 8 final+=chr(val("&B"+mid(outputs,a,8))) next

return final

end function'==============================================================================='============================================================================Function decompress_loop( chrs as string ) as string