Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HHC 2010 RPL Programming Contest

46 views
Skip to first unread message

Joe Horn

unread,
Oct 1, 2010, 4:13:19 PM10/1/10
to
HHC 2010 Progamming Contest
Input: List of integers > -1E12 and < 1E12
Output: Same list with odd integers first, sorted, then evens, sorted.
Winner: Lowest Bytes*Time.
B*T shown here obtained on list of 64 random integers, pos & neg, with
display clock turned off.

--
%%HP: T(3)A(R)F(.);
DIR

BVB
@ B*T Score: 118
@ The Winner, Bill Butler!
\<< I\->R SORT DUP SIZE 3. ROT +
\<< DUP R\->I SWAP 2. MOD { OVER ROLLD } { UNROT 1. + } IFTE
\>> STREAM DROP \->LIST
\>>

PRGM2
@ B*T Score: 269
\<< SORT OBJ\-> { } { } 1 4 ROLL
START ROT DUP 2 MOD { SWAP + } { ROT + SWAP } IFTE
NEXT SWAP +
\>>

PRGM3
@ B*T Score: 311
\<< SORT { } DUP 1. 4. PICK SIZE
FOR i PICK3 i GET DUP 2. MOD { ROT SWAP + SWAP } { + } IFTE
NEXT + NIP
\>>

PRGM4
@ B*T Score: 572
\<< DUP 2. MOD DUP2 0 1.
FOR n n - ABS 6. SQ ALOG NEG * - SORT 6. SQ ALOG + DUP 6. SQ ALOG
POS 1. - 1. SWAP SUB 3 n - ROLLD
NEXT + R\->I
\>>

PRGM5
@ B*T Score: 812
\<< SORT DUP 1.
\<< DUP
IF 2 MOD NOT
THEN DROP
END
\>> DOLIST
IF DEPTH 1. >
THEN SWAP
END 1.
\<< DUP
IF 2 MOD
THEN DROP
END
\>> DOLIST
IF DEPTH 1. >
THEN +
END
\>>

END

Wes

unread,
Oct 9, 2010, 6:22:38 AM10/9/10
to
On Oct 1, 11:13 pm, Joe Horn <joeh...@holyjoe.net> wrote:
> HHC 2010 Progamming Contest
> Input: List of integers > -1E12 and < 1E12
> Output: Same list with odd integers first, sorted, then evens, sorted.
> Winner: Lowest Bytes*Time.
> B*T shown here obtained on list of 64 random integers, pos & neg, with
> display clock turned off.

Here's mine. It would've been 2nd, but it takes a different approach.

@ B*T Score: 228
\<< I\->R SORT DUP 2. MOD NOT SWAP 2. \->LIST TRAN SORT
TRAN 2. GET R\->I
\>>

-wes

0 new messages