Ad
  • Custom User Avatar

    It looks good to me. I clicked approve not sure how long it will take to go through the system.

  • Default User Avatar

    Thanks for the comments the challenge made sense afterwards

  • Default User Avatar

    Something I couldn't understand was about how you've already lost one round in the wager and had to pay up. I was thinking that you pay an initial wager, and every time you lose, the wager doubles, and doubles, until the amount doubling reached the amount of losses. I'm not talking about Martingale, only talking about the wager doubling. I was somewhat confused until I saw the pattern with the compare, any of y'all confused too?

  • Default User Avatar

    thank you, i thought it was a Martingale ...

  • Custom User Avatar

    It's a little bit confusing when in description we have rounds as an argument and in function we see losses (but author add this in decription: "This consistently results in me losing [...]"). After all I think the idea is not so complicated to demand example tests in description, but everyone has an opinion.

  • Custom User Avatar

    Losses - number of played rounds ("This consistently results in me losing [...]"), so all rounds were lost :)

  • Custom User Avatar

    I don't understand what we're supposed to be doing here.. My understanding is laid out below:

    1. You take the initial wager amount, and then lose (loss #1)
    2. You then double it, and then lose (loss #2), and repeat this step for the number of times in the losses argument.

    So for a cash = 11, wager = 2, and losses = 3, you'd expect to lose 2 on the first round, 4 on the second, and 8 on the third, which is a total wager of 14. Because that's more than the amount of cash that you have, you can't pay up and have to pay later. This is obviously not what the program wants... so how should I be understanding it?

  • Custom User Avatar

    i do not understand this (cash, wager, losses) .. what do you mean by losses? the amounth of times they bet?

  • Custom User Avatar

    @Johan, Why did you approve this one?

    • No example tests in description

    • Description requires re-wording and re-formatting

    • Node 14. should be enabled

  • Custom User Avatar

    Python translation I liked this kata. XD

  • Custom User Avatar

    I'm learning a lot looking through this, thank you so much! I get super lazy with scope sometimes, but actually seeing this makes it pretty clear that it will save me a lot of work in the long run if I just commit to it. Super excited to take this in stride and improve off it :D

  • Custom User Avatar

    A for effort, but reserving my judgement because it's a bit of a tangled spaghetti, well, mess.

    I've forked my solution to show cleaned up tests, with some comments. Read and learn! Your current tests probably work because no existing solutions were invalidated, but if you do want to clean up some, write your own code. I tested what I wrote against my own solution only. I don't think there are bugs. :P

    ( The lack of let and const is most likely to bite you in the long run. If you take away one thing from it, please let it be that. )

  • Custom User Avatar

    Gotcha, thanks for the advice! I wasn't expecting this to gain any traction at all, so ratings weren't exactly something I was concerned over in the first place haha.

    It's a first kata and I've thankfully learned from it, so I'll just take what I can moving forward and improve =]

    Oh also random test cases are in there now lol

  • Custom User Avatar

    Returning inconsistent data types is not a best practice.

    In this case, it's just cute; normally, special cases often call for either an Error to be thrown or a special value of the consistent type that can never result from valid calculation ( -1 for an Int that should have been unsigned is close to the edge already ).

    Don't worry too much 'bout it - strongly typed languages have sum types for this, so translations are not impossible. But if you're going to return a string for money below zero, you may as well ask for "a week of desserts, doing the dishes, your car keys, your clothes and your dignity". :yum:

  • Custom User Avatar

    Ah, good on you. :]

    Unfortunately, you've been collecting bad ratings already, and not all of those people may come back to change their vote if and when you republish with random tests.

    You really need to get most everything right straight off the bat to have your kata survive let alone thrive, and having random tests is a mostly quite unavoidable part of that. The bar for creating kata is much, much higher than for solving kata; that's just the way it is.

    Happy coding! ^^

  • Loading more items...