## Search found 4829 matches

Jul 23, 2019 18:34
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@Dodicat I figured out how to turn 16 bits into 14 bits...But it's lossey compression.. compresses 90+% after 20 loops. The output is 0 to 4 higher or 1 less.. The under / over requires 3 bits... so the out would be 17 in that case. no compression.. screen 19 dim as longint n1 , v1 , v2 , ans dim as...
Jul 23, 2019 15:58
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@D.J.Peters @Richard I figured out how to get the missing bit... n1 = ?? v1 = n1 mod 8 v2 = n1 \ 16 v3 = (n1 and 8) shr 3 screen 19 dim as longint v1 , v2 , v3 dim as longint n1 = 256 do n1-=1 v1 = n1 mod 8 v2 = n1 \ 16 v3 = (n1 and 8) shr 3 print print n1 , v1 , v2 , v3 for b as longint = 0 to 255 ...
Jul 23, 2019 2:39
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@Richard Electronics uses very little math .. I only took "General Math" in high school , i didn't take algebra or geometry or calculus.. In electronics the most difficult formula just uses a square root. For repairing electronics , they have testers for just about every component on a cir...
Jul 23, 2019 2:08
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@D.J.Peters

with

v1 mod 8
v2 \ 16

String+= str( v1 ) + str( v2 )

How do i add the missing bit to the string?
call the missing bit v3
Jul 23, 2019 1:45
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@D.J.Peters

How do you isolate bit 3 ?

v1 = n1 mod 8 = 3 bits
v2 = n1 \ 16 = 4 bits

7 bits out compresses....

How do you get the 8th bit??

It might not compress with 8 bits out...
Jul 23, 2019 1:29
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@D.J.Peters It's returning right for 16's But splits into 2 sets for the in between nums screen 19 dim as longint n1 , v1 , v2 , ans for a as longint = 0 to 255 n1 = a v1 = n1 mod 8 v2 = n1 \ 16 ans = v1 + ( 16 * v2 ) print n1 , v1 , v2 , ans if a mod 16 = 0 then sleep if inkey = chr(27) then exit f...
Jul 23, 2019 0:24
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@Richard
@Dodicat

@everyone

How would you reverse the following??

n1 = 0 to 255
v1 = n1 mod 8
v2 = n1 \ 16

How would you get n1 back , out of the v1 and v2 ???
Jul 22, 2019 19:14
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

works the same with: a = 9999 v1 = asc( chr( a ) ) , same as v1 = a mod 256 count = a \ 256 answer = v1 + ( 256 * count ) screen 19 dim as longint v1 , count for a as longint = 0 to 9999 v1 = asc( chr(a) ) count = a \ 256 print a , v1 , count , ( v1 + ( 256 * count ) ) if a mod 1000 = 0 then sleep i...
Jul 22, 2019 18:23
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@Richard While playing and and fumbling around , trying to figure out how to handle the "3 nums" that are larger than 255.. I happened upon a cool formula.. ( v1 + ( 255 * count ) ) + count = the input screen 19 dim as longint v1 , count for a as longint = 0 to 9999 v1 = asc( chr(a) ) if a...
Jul 22, 2019 15:20
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@Dodicat Soon ; i should have it working!!! I've been analyzing the outputs , and i think i got it figured out.. Now it's just a matter of fumbling around till i get it working.. In the compression , final_out+= chr( 3 nums ) , sometimes the "3 nums" are greater than 255. ?? How to proceed...
Jul 22, 2019 1:09
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@Richard @Dodicat An update!! It was sometimes getting stuck , I fixed the bug... Now sometimes the output = the input instead of being 1 lower. Can someone help write the de-compressor ???? It compresses 100,000 bytes to less than 10,000 in 7-8 seconds.. It compresses 1,000,000 bytes to less than 2...
Jul 22, 2019 0:17
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@Richard @Dodicat I got compression without Zlib... Now to write the de-compressor... Can one of you two or someone else, help with the de-compressor? Declare Function compress_loop( chrs as string ) as string Declare Function decompress_loop( chrs as string ) as string screen 19 dim as double time1...
Jul 21, 2019 16:56
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@Dodicat @Richard This code is 1:1 compression.. But I'd like to figure out the de-compression, anyways. Keep pressing a key the next compression. It's sometimes de-compressing okay. but mostly not.. Can one of you guys help?? Declare Function compress_loop( chrs as string ) as string Declare Functi...
Jul 21, 2019 16:51
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@coderjeff
@imortis

I'll keep it to just posting code.... and asking for programming help...I'll keep everything on topic...
Jul 20, 2019 16:58
Forum: General
Topic: Squares
Replies: 6745
Views: 384511

### Re: Squares

@Dodicat I made it so it tells you how many "1's" were looking for.. I think if you start at the end of "map" and work backwards by 2's and look for "11" ?? Declare Function compress_loop( chrs as string ) as string Declare Function decompress_loop( chrs as string ) as ...