[REBOL] Re: Algorithm challenge: compacting integers
From: SunandaDH::aol::com at: 20-Jan-2007 7:47
We've had two entries so far on the REBOL3 Altme world. Thanks guys! (and it
would be good if you could send your entries here so everyone can see what
they have to beat!)
And there was a mistake in the spec:
The first example of SKIMP shows (correctly) a two-digit sequence being
compacted to Nx2. But the example of what compact and decompact should do shows
(wrongly) two-digits sequences being unchanged.
My mistake!! Sorry!! I Hope that does not mess up any elegant code you are
The examples should read:
probe compact [1 2 3 10 11 99 101 2000 2001 2002 2003 2004]
== [1x3 10x2 99 101 2000x5]
probe decompact 1x3 10x2 99 101 2000x5]
== [1 2 3 10 11 99 101 2000 2001 2002 2003 2004]
Good luck if you are still playing!
And aplogies if your code exactly implemented the wrong spec.