Skybuck's Universal Code 4 (memory efficient)

May 26, 2007 47 Replies

You should be ashamed of yourself !

Such a simple solution and yet you cannot understand or code it.

Therefore, I shall code it and show you !

Once I have posted the code, you will forever address me as/call me:

Master Genius Skybuck :)

I'll be done coding, in a few hours.

Bye, Skybuck.

Perhaps, but not for what I wrote here.

I never claimed to be the genius.

Rudy Velthuis http://rvelthuis.de "I\'m not going to get into the ring with Tolstoy." -- Ernest Hemingway (1899-1961)

Read up on the authors of cold fusion before removing foot and shooting off mouth ;-)

...Jim Thompson

| James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC\'s and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | | http://www.analog-innovations.com | 1962 | America: Land of the Free, Because of the Brave

Little improvement:

The math unit is not needed.

// replace uses with: uses SysUtils, Classes;

Neither is the following function:

delete these lines:

// limited to 64 bit values, returns 1 for value zero. function bits_needed_for_decimal_value( value : extended ) : integer; begin // result := round( ceil( log10(1+value) / log10(2) ) ); // same as this I hope: result := round( ceil( log2(1+value) ) ); if result = 0 then result := 1; end;

Rest stays the same.

Bye, Skybuck.

I wrote a demonstration program.

View it, study it, understand it.

And maybe then you will see the light =D

Bye, Skybuck ;)

Little addition to the comments:

{

Also it can be handy to have an output example of this demonstration program for reference:

*** Begin of Output: ***

program started Operation: Size: 1 Data Bits: 0

Field1: Size: 14 Data Bits: 00100100000001

Field2: Size: 5 Data Bits: 00101

EncodedInformationStream: Size: 36 Encoded bit stream: 110000111100010010000000100110100101

press enter to continue with decode demonstration

Operation: Size: 1 Data Bits: 0

Field1: Size: 14 Data Bits: 00100100000001

Field2: Size: 5 Data Bits: 00101

program finished press enter to exit

*** End of Output: *** }

Bye, Skybuck.

Also it would be handy if outlook express had a message preview or even better an automatic line limiter... because some code comments got broken into multiple lines... by outlook express... which would cause compile problems ofcourse... so you would need to correct that.

With current outlook one doesn't get a true... "what you see if what you get post" ;)

Bye, Bye, Skybuck.

;)

you don't.

you start with a small tree capable of encoding anything and as you encode you grow it.

Bye. Jasen

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required