1st International Longest Tweet Results
Dr_Evil6_6_6 writes "Slashdot had a story about the 1st International Longest Tweet Contest last month, and the winners have just been announced." The winner is impressive.
← Back to Stories (view on slashdot.org)
FTA:
:= K // Initialize accumulator := a % N // Extract lowest-order digit from accumulator := U + d // Convert base-N digit to 32-bit character := c // Store 32-bit character in message := (a – d) / N // Subtract lowest-order digit and shift accumulator right
:= 0 // Initialize accumulator := M[i] // Extract 32-bit character := c – U // Convert 32-bit character to base-N digit := (a * N) + d // Shift accumulator left and add digit
"Todd Lehman says:
March 25, 2010 at 10:14 pm
The maximum number of bits you can squeeze into a tweet using 32-bit non-Unicode characters is 4339.
Below is an algorithm which uses large-integer arithmetic to carry out operations which encode and decode a 4339-bit value. Perhaps someone can develop this into a working program.
Constants:
Let V = 2 = 2147483648 be the number of non-negative integers representable in 31 bits.
Let U = 10FFFF + 1 = 110000 = 1114112 be the number of valid Unicode code points.
Let N = V – U = 2147483648 – U = 2146369536 be the base for numeric conversions below.
The encoding and decoding algorithms below operate on the principle that 4339 / logV 139.97 and that ceil(4339 / logV) = 140.
Encoding algorithm (K M[140])
(1) Let K be any 4339-bit integer
(2) a
(3) for each i in {0..139}:
(3a) d
(3b) c
(3c) M[139-i]
(3d) a
(4) Output M[140]
Decoding algorithm (M[140] K)
(1) Let M[140] be an array of characters representing a message to decode
(2) a
(3) for each i in {0..139}:
(3a) c
(3b) d
(3c) a
(4) K = a"
Anyone care to translate?
my karma will be here long after I'm gone