Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

73 chars, called on a foul (Re: LFSR golf)

by tye (Cardinal)
on May 08, 2001 at 18:32 UTC ( #78832=note: print w/ replies, xml ) Need Help??


in reply to Re: LFSR golf
in thread LFSR golf

I don't mind the departure in how you call the generating function but I'm going to disqualify this one for having the closure return "50101" instead of 0 and "51100" instead of 1.

If you were shifting the other direction, then a simple &1 at the end of the closure would solve the problem and give you a 73-character solution (not counting the "sub l{" and "}", as usual).

I'm sure this general approach can be modified such that I'd accept it but I'll leave that to you or whoever beats you to it. (:

        - tye (but my friends call me "Tye")


Comment on 73 chars, called on a foul (Re: LFSR golf)
Download Code
Re: 73 chars, called on a foul (Re: LFSR golf)
by Anonymous Monk on May 08, 2001 at 20:25 UTC
    Didn't know you wanted that. OK. New version (72 chars)
    sub l{ my($s,$t)=@_;sub{($s=($s.(((my$x=$s+$t)=~y/1/1/d)%9%2)))=~s/5(.)/5/;$1 +} } $x=l("50101","0022");print ($x->(),$x->(),$x->(),$x->());

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2014-08-01 16:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (28 votes), past polls