Leading the way to the Future
Welcome Guest, Login!
03 Jun 2008 07:02:44 pm by Ed H
Edit: Okay, since some people didn't quite understand the challenge the first time, I reworded it.

Write a program that stores 54 binary bits in a 9-byte real number, and another program that retrieves the stored bits from the 9-byte real number. You should be able to input 54 binary bits into the first program, take the output from that program and input it into the second program, and get your original input back. You can use whatever input or output you want for either program; if your storage program outputs to Ans, and your retrieval program inputs from A, that's fine.

Aim for the smallest combined codesize (That is, codesize minus the length of the titles). So far the smallest anyone has got it is 151.
03 Jun 2008 10:09:18 pm by luby
Your wording is a bit vauge. Are we to write a program that discerns whether to use a string or a list for input, or what??



sum(L12^seq(I,I,dim(L1)-1,0,‾1

int(round(2fPart(N2^seq(I,I,‾int(log(N)/log(2))-1,‾1

(source)http://weregoose.unitedti.org/routines.html
the first does what you specified for a list and the second returns a list of binary digits of number N
03 Jun 2008 10:23:07 pm by Weregoose
Guh, I need to take that site down during challenges. :P

I also need to work on the updated version...
04 Jun 2008 10:15:26 am by Ed H
luby wrote:
Your wording is a bit vauge. Are we to write a program that discerns whether to use a string or a list for input, or what??



sum(L12^seq(I,I,dim(L1)-1,0,‾1

int(round(2fPart(N2^seq(I,I,‾int(log(N)/log(2))-1,‾1

(source)http://weregoose.unitedti.org/routines.html
the first does what you specified for a list and the second returns a list of binary digits of number N
[post="124217"]<{POST_SNAPBACK}>[/post]

Choose whatever input or output you like. By the way, it's not that easy Wink . You need to store 54 bits. Store randInt(0,1,54 to L1, perform your first routine on it to A. Then perform your second routine on A and store the list to L2, and compare the lists.
04 Jun 2008 11:13:15 am by DarkerLine
To clarify the wording of the challenge as I see it: the code isn't meant to convert the binary list to a real number. The idea is to somehow pack those 54 bits in the structure of a real number.
05 Jun 2008 04:04:12 pm by Ed H
Here's a solution. 151 bytes total.
68 bytes for storage, from a list in Ans to a real in Ans:
Quote:
:(1-2Ans(1))10^(sum(seq(2^(X-2)Ans(X),X,2,8)-6))(E13+sum(seq(2^(X-9)Ans(X),X,9,54

83 bytes for retrieval, from a real number in the variable A to a list in Ans:
Quote:
:29+int(log(abs(A
:augment({A<0},int(2fPart(Ans.5^seq(X,X,1,7→A
:-E13+abs(A10^(13-int(log(abs(A
:augment(∟A,int(2fPart(seq(fPart(Ans10^(-X))5^X,X,1,46

The code for converting a decimal to binary is loosely based off of one of Harrierfalcon's routines. Thanks =P.