Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Golf Challenge - does $x and $y fit into the same slot on @z?

by BrowserUk (Patriarch)
on Dec 28, 2002 at 01:54 UTC ( [id://222671]=note: print w/replies, xml ) Need Help??


in reply to Re: Golf Challenge - does $x and $y fit into the same slot on @z?
in thread Golf Challenge - does $x and $y fit into the same slot on @z?

Erm. Isn't that covered by the bit that says:

#When determining "betweeness", treat any cases where $x or $y equals a value in @z as if $x or $y was actually less than that value.
?

By my (probably flawed) reading of that, your first case would be a fail because the $x would be judged less than the second element of @z

And the second case would be a pass as both $x and $y would be judges as being lower than the first valeue of @z


Examine what is said, not who speaks.

  • Comment on Re: Re: Golf Challenge - does $x and $y fit into the same slot on @z?

Replies are listed 'Best First'.
Re: Re: Re: Golf Challenge - does $x and $y fit into the same slot on @z?
by sauoq (Abbot) on Dec 28, 2002 at 02:03 UTC
    Erm. Isn't that covered by the bit that says

    Hrm. It's a debatable point, I suppose.

    It explicitly states that that should be the strategy when determining "betweeness" whereas the example test cases I gave were those dealing with "greater than" or "less than" all the numbers in the array. I'm wavering more toward the poorly stated specification option now, though.

    -sauoq
    "My two cents aren't worth a dime.";
    

      Understood. I took it to be a "fenceposts" problem

      • -infinity < ($x & $y) <= $z[0]
      • $zn < ($x & $y) <= $zn+1
      • $z-1 < ($x & $y) <= +infinity

      but now you have pointed out an alternative reading, I can see the ambiguity.

      20:20 vision in hindsight :^)


      Examine what is said, not who speaks.

      I'm wavering more toward the poorly stated specification option now, though.

      You're probably right, although BrowserUk did have the correct interpretation.

      It was my first golf challenge ever. If I ever get the courage to post another one, I will be sure to be more clear. Although, I have the feeling that no matter How clear I make it, there will always be somebody that will find a loophole.

Re(3): Golf Challenge - does $x and $y fit into the same slot on @z?
by ehdonhon (Curate) on Dec 28, 2002 at 16:28 UTC

    Yes, you are correct.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 04:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found