Is there a way to get compression out of your remainders code???
I did my program a little different...
Now you adjust the values upwards by 1 until you get an output.. If the mods don't have an equal , it just outputs nothing..
If the mods equal the output then it prints out the various values that equal up to the input...
If it gets 255 correct it will get all lower bytes okay as well..
Code: Select all
dim as longint v , v1 , v2 , v3 , v4
dim as longint md1 , md2 , md3 , md4
'ADJUST 4 , 9 , 12 TO DIFFERENT VALUES , HAS TO BE 3 OR GREATER
md1 = int( rnd * 4 )
md2 = int( rnd * 9 )
md3 = int( rnd * 12 )
loop until md1 > 1 and md2 > 1 and md3 > 1
v = 255 'int( rnd * 256 )
v1 = v mod md1
v2 = v mod md2
v3 = v mod md3
dim as longint s , s1 , s2 , s3 , s4 , value
for b as longint = 0 to 65536 step 1
s = b
s1 = s mod md1
s2 = s mod md2
s3 = s mod md3
if s1 = v1 and s2 = v2 and s3 = v3 then value = b : exit for
if v = value then print v , value , md1 , md2 , md3 : sleep
loop until inkey = chr( 27 )
I tried it with 65535... it outputs more than 16 bits at the smallest...
Every set that equals the input , add up to more bits than the input...