Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Compression in Golf: Part I

by eyepopslikeamosquito (Canon)
on Oct 01, 2012 at 02:48 UTC ( #996573=note: print w/ replies, xml ) Need Help??


in reply to Compression in Golf: Part I

I just realized we can reduce my original packed 95-stroker:

map$c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($`%12^$_?o:x)&($'/+5^$ a.$_?o:v125),0..s//<>/e./:/;print"@$_\n"for@c
by two strokes:
map$c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($`%12^$_?o:x)&($'/5^$_ ?o:v125),0..s//<>/e./:/;print"@$_\n"for@c#```
As you can see from the table below, the "?" character, by pure fluke, is two before "A" in the ASCII table:

ordpacklenchr
6331?
6432@
653345A

So we can hijack pack's "?" length byte as part of our ternary expression! Note that we padded the source program with #``` at the end to keep its length at 45, the required multiple of four.


Comment on Re: Compression in Golf: Part I
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996573]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2015-07-02 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (40 votes), past polls