7 kyu

Price is right

Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • justinddaniel Avatar

    Good kata, but let's not make misogynistic references such as female canines, as I saw on the JavaScript kata!

    • Austin Haws Avatar

      The title is a play on the game show The Price is Right. Happy Gilmore has Bob Barker in it. A quote from Happy Gilmore from Bob has swearing. I didn't want to abuse any code warrior's sensitive untainted eyes, so I used the direct definition of the swear. HA!

  • user6354551 Avatar

    approved as test suite looks sufficient, no pending issues, choice of title was explained by author and there aren't any negative votes

  • Chrono79 Avatar

    I know maybe I'm being picky, but I fail to see where is the price in this kata (both in the title and function's name). The tests use negative numbers too, so prices seem wrong to me.

    • JohanWiltink Avatar

      Isn't that a reference to some TV programme where you had to guess prices of things?

      Negative numbers are a very natural continuation of natural numbers ( non-negative, i.e. prices ), so I see no real problem there.

    • Chrono79 Avatar

      Isn't that a reference to some TV programme where you had to guess prices of things?

      Maybe, it just felt a little disconnected about what to do here (to me at least).

    • Austin Haws Avatar

      Chrono79, you are the next contestant on the Price is Right! Come on down! And don't forget to spay or neuter your pet. lol.

      It's a game show where you have to guess the price without going over. I didn't want the hassle of dealing with decimals, so let's just pretend that the integers are the prices in ¥en.

    • Chrono79 Avatar

      Lol. It's clear now thanks both.

      Question marked resolved by Chrono79 7 years ago
  • JohanWiltink Avatar

    Returning inconsistent datatypes is not a best practice.

    I'd suggest throwing an Error, returning NaN ( which actually is a Number ), undefined ( which, polymorphically, might be a Number ), or possibly -Infinity.