in reply to Playing Golf on Saturn

There's one hell of a lot of redundancy in the data, which is part of the program. Compress it. Even trivial encoding like RLE reduces it from 2451 characters to 525 characters. The encoding here is simply a character followed by digits for the number of times it appears.
75'6 1 71'11 1 67'15 1 64'17 1 61'19 1 59'20 1 57'21 1 37~13 5'7 6'9 1 34~19 3'4 8'8 1 31~24 12'7 1 28~29 9'7 1 26~32 7'6 1 25~34 5'6 1 24~36 3'5 1 23~38 1'5 1 22~37 2'4 1 21~36 2'4 1 21~35 2'3 1 20~34 2'3 2~2 1 20~32 2'3 2~4 1 20~30 2'3 2~6 1 20~28 2'3 2~8 1 20~26 2'3 2~10 1 20~24 2'3 2~11 1 20~22 2'3 2~13 1 18'2~19 2'3 2~15 1 16'5~16 2'3 2~16 1 14'6 2~13 2'3 2~17 1 13'5 5~10 2'3 2~18 1 11'6 7~6 2'3 2~20 1 9'7 10~2 2'3 2~21 1 8'7 12'4 2~21 1 6'9 8'5 2~22 1 5'10 4'9 4~17 1 4'22 9~10 1 3'20 1 2'18 1 1'16 1'14 1'11 1 2'6
This can be trivially improved by: That latter is moderately interesting. After getting rid of 1s, we have to encode numbers in the range 2 to 71, and you have four unique characters in your data. So we need 74 unique characters. Represent your four data characters by the first four normally printable ASCII characters - \t, \n, space and pling. Then represent the numbers 2 to 71 with ASCII characters 34 to 103.

Replies are listed 'Best First'.
Re^2: Playing Golf on Saturn
by eyepopslikeamosquito (Archbishop) on Oct 15, 2004 at 09:39 UTC

    Finding the best compression for this data is certainly an interesting problem and I don't mind at all if people pipe up on that (I used a compression scheme in Spinning World, for example, and am always looking for improvements).

    However, for the purposes of this golf game, let me clarify that the golf score (491 in my example fat test program above) is calculated for the code before the __DATA__ only. You get the __DATA__ and the Saturn shape for free in this game because in the obfu I can, cough, get it very cheaply by reading the source.