Ad
  • Custom User Avatar

    Thanks for that (and the link)— I'm a newbie at posting kata of my own so I don't quite know the rules/culture.

  • Custom User Avatar

    Thanks for the feedback, I simplified everything to champagne in the description so people don't get confused whether or not wine is different from champagne. I've kept bottle in the function name because that is an accurate label, the function is called as each bottle of champagne is doled out one-by-one for poison-testing.

  • Custom User Avatar

    This is the same problem, but this kata provides the logical strategy behind discovering the wine bottle. Mine requires you to solve the whole problem, from coming up with the strategy of using minimal rats to suss out the poisoned bottle, all the way to identifying said bottle at the end.
    Apologies if that is too similar, but since this version is several steps longer I thought it was justified (and I didn't know about this one beforehand anyway).

  • Custom User Avatar

    Thanks for that, updated the initial provided code to be consistent/correct.

  • Custom User Avatar

    Hey all! Trying to design my first kata, but I think it might not be possible?...
    It's a riddle kata... you get n items, and one of these items is poisoned. It's your job to find the poisoned item, n_? out of n total. (In addition to severe limitations on how many trials you can do to find it, that's the tricky part.)
    Now, obviously, the n_? item needs to be marked in some way so that when you're experimenting, it can interact with your data objects to give you clues about its identity.
    But how can I give the kata-goers this variable n_? in a secret/hidden fashion without them just saying, well let me just print out the given function parameter n_? and return that, instead of truly 'solving it'?
    Are kata riddles always this hard/impossible to implement when there needs to be some hidden clue you have access to, but not direct access to?...

  • Custom User Avatar

    (Python, sorry~)

    And correct! Stupid of me, but yes I had given the function a third (thought defaulted) input (ans=[]), because I recursed and needed to pass on my accumulating list of squares. Must have screwed up the testing apparatus?
    Code could be less clunky, but it works and is submitted now. Ended up just pasting everything in a helper function so I could keep that logic. Will have to fine-tune later.

    Thanks!

  • Custom User Avatar

    Issue: my code runs and outputs the exact array as Expected. HOWEVER... in the tests console, I pass test #1, but then for each subsequent test, my output answer is my actual/the real answer (again, tested in Atom and PythonTutor.com) BUT with the previous answer stacked on top of it!
    Here is my final console print for each test-- as you can see, each is 'stacked' with the previous test's answer PLUS this test's answer.
    SOLUTION!: [3, 2, 1, 1]
    SOLUTION!: [3, 2, 1, 1, 3, 2, 1, 1]
    SOLUTION!: [3, 2, 1, 1, 3, 2, 1, 1, 14, 6, 6, 2, 2, 2]
    (and it continues this indefinitely...)

    This issue does not happen in Atom or any other program that I run. Is this a bug on your side? Or is could there be a small error in my code? (though I don't know how my code could save a previous test's answer!!!)

  • Custom User Avatar

    Found the same bug: "See Also" links are pulled by my code, which limit to

    (which 'See Also' is in), but the kata solution does not include, thus my solution fails.
  • Custom User Avatar

    Thanks for the help! Don't know if it'll help but I think I understand it more. (Sorry, didn't want to post code, don't know the rules about spoilers...) I'll try it out now though~

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution