Click here to Skip to main content
15,886,362 members

Comments by albert_redditt (Top 1 by date)

albert_redditt 10-Sep-21 13:22pm View    
Deleted
Here's the main loop : It's for a data compressor...
Currently it's set for 1,000,000 bytes.. or 8,000,000 bits , input.
It takes 250 loops through the below loop..
It's currently taking 40 to 45 seconds to do the 250 loops..
10,000,000 bytes in , would take 10 times longer , 450 seconds..


dim as string outs = ""
dim as string n2
dim as longint v1 , v2 , v3 , v4 , v5
for a as longint = 1 to len( bits ) step 6

n1 = mid( bits , a , 6 )

v1 = ( ( n1[ 0 ] - 48 ) * 2 ) + ( n1[ 1 ] - 48 ) + 1
v2 = ( ( n1[ 2 ] - 48 ) * 2 ) + ( n1[ 3 ] - 48 ) + 1
v3 = ( ( n1[ 4 ] - 48 ) * 2 ) + ( n1[ 5 ] - 48 ) + 1

v4 = ( v1 + v2 ) - 1
v5 = ( v2 + v3 ) - 1

if v2 mod 2 = 1 then v4+= 8
if v2 mod 2 = 0 then v5+= 8

n2 = "00"
if v4 < 10 then n2[ 0 ] = 48 + v4 else n2[ 0 ] = 65 + ( v4 - 10 )
if v5 < 10 then n2[ 1 ] = 48 + v5 else n2[ 1 ] = 65 + ( v5 - 10 )

outs+= n2

'print n2
'sleep
'if inkey = " " then end

next