Ad
  • Custom User Avatar

    The tests for this kata are flawed. If you "null" out all spots for shoes in the ShoeRack and then submit that as your result, you will pass 100% of the tests.

  • Custom User Avatar

    Encountering the following error:

    An error occurred while loading ./spec/solution_spec.rb.
    Failure/Error:
    RSpec.describe Rotator do
    subject(:rotation) { described_class.new(square).rotate(degrees) }

    describe "#rotate" do
      context "with 1x1 square" do
        let(:square) {
          [
            %w[A],
          ]
        }
    

    NameError:
    uninitialized constant Rotator

    ./spec/solution_spec.rb:1:in `<top (required)>'

    No examples found.

  • Custom User Avatar

    The description for this kata contains several ambiguities/issues.

    1. You state that if "the population of foxes and rabbits exceeds 1000, in which case it will return", "The population is out of control. Year X".

    What do you intend this to mean? If the poplulation of foxes AND the population of rabbits both exceed 1000, you return the message? If the sum of the foxes and rabbits exceeds 1000, you return the message? If the popluation of foxes OR the population of rabbits exceeds 1000, you return the message?

    1. Your description states that you expect 1 of 3 messages to be returned. Each of these messages end in "Year X". Your kata however expects each message to be termineated with a period "." .

    The kata description needs to be updated.

    1. It appears that you expect the three conditions to be checked only at the end of each year. If so you should explicitly state that in the description to clear up the ambiguity. Refer to the following example example.

    Year = 0
    foxes = 999 rabbits = 1

    Year = 1
    In the Spring, the rabbit population doubles and the fox population is increased by 50% resulting with: foxes = 1498; rabbits = 2
    In the Summer, each fox eats a rabbit, resulting with: foxes = 1498; rabbits = 0
    In the Autumn, hunters kill 20 foxes, resulting with: foxes = 1478; rabbits = 0

    With this example, your kata expects the response to be "All rabbits were eaten. Year 1." However, at the end of the Spring in year 1 there were 1,498 foxes, which implies that the response should be "The population is out of control. Year 1." since the fox population exceeds 1000 and there are still 2 rabbits alive.

  • Custom User Avatar

    I'm receiving an "Exit Code 1" error message "Response received but no data was written to STDOUT or STDERR." when attempting to test my code by hitting the "Test" button. When I execute my code by hitting the "Attempt" button, all tests pass. The "test" button is not functioning correctly.

  • Custom User Avatar

    Great job!!! The problem has been resolved.

  • Custom User Avatar

    Unfortunately, I'm still experiencing the same problem.

  • Custom User Avatar

    There appears to be a problem with the Coffeescript version of this kata. For approximately 15% of the tests, I'm seeing an invalid player array being passed into the test. In one case, the players array contains [0, 1], indicating that Alice is playing Bob even though they are on the same team. In another case, the players array contains [1, 1], indicating that Bob is playing himself.

  • Custom User Avatar

    In your kata's description you state "max_num is a number that includes all indices in the array from 0 to max_num. Task Return an array from 0 to max_num, where the index corresponds to the number." The way that I first interpreted your description is that the resulting array should include an index for "max_num". I think that your description would be clearer if you explained that the resulting array should contain an "array from 0 (inclusive) to max_num (non-inclusive)".

  • Custom User Avatar

    The "random tests" for the Ruby version of this kata has a problem. If "n" is a prime number, the random tests expect "1 => 1" to be included in the response in addition to "n => 1". This problem does NOT occur for the fixed tests however. Here are some examples of the errors that I received when "n" was a prime number: Expected: {393541=>1, 1=>1}, instead got: {393541=>1}; Expected: {240743=>1, 1=>1}, instead got: {240743=>1}; Expected: {101939=>1, 1=>1}, instead got: {101939=>1}. The random tests do work correctly when "n" is not a prime number.

  • Custom User Avatar

    Both the Python version and Javascript version of this kata is broken.

  • Custom User Avatar

    The Javascript version of this kata is broken. The "Sample Test" section in the Javascript version is "Java" code and is identical to the "Java" version of this Kata.

  • Custom User Avatar

    Your actual kata code does not match the description. In your kata description, you show a key of "5" for the "Hello World" example. You then convert the "5" to binary, giving 101. You then repeat the binary key enough times to match the length of the binary encoded plaintext. If you follow these instructions however, all tests will fail. You can only pass the tests if you pad the binary representation of the key to 8 bits before repeating the pattern to match the length of the binary encoded plaintext. You either need to update the description or fix your code.

  • Custom User Avatar

    Thanks for the follow up. My first solution was to enclose all of the tuple pairs in a List of Tuples as is documented in the instructions. Although my code generated all of the correct tuple pairs, every test failed, showing that the desired output was to enclose the tuple pairs in a List of Lists. So I changed my code to output the tuple pairs in a List of Lists. This time, all test cases passed with the exception of that one test. That is what prompted me to submit my original post describing these problems. After the author changed the code to accept either a List of Lists or a List of Tuples, my code still failed that one test. I then just hardcoded around that one test so I could pass all of the tests. What I still don't understand is that after reviewing the other solutions, they are all generating a List of Tuples. When I generate a List of Tuples however, none of the tests passed. My code only passes the tests if I generate a List of Lists (with that one exception). Very strange!!!!

  • Custom User Avatar

    This is a very strange problem. After seeing that 10 people had successfully solved your kata, I decided to "reset" the kata and start over. For whatever reason however, I am still encountering the exact same problem. It appears that I am trying to solve an older version of your kata. Since other Codewars users don't seem to be having this problem, I put a special, one off, check in my code to handle the one test differently than the others. My version of your kata is still looking for the resulting tuple pairs to be enclosed in a List of Lists instead of a List of Tuples with the exception of that one test. Thanks for trying to fix this but I somehow must be accessing an older cached version of your kata.

  • Custom User Avatar

    Problem 1:
    Your kata states "You must return a list of tuples containing all coordinates pairings. (Order of pairing doesn't matter e.g. ((0, 0), (1, 1)) or ((1, 1), (0, 0))". Your tests however appear to be looking for a List, containing "Lists" of tuple pairs. For example, [[(0, 0), (0, 2)], [(0, 0), (1, 0)], [(0, 2), (0, 4)], [(0, 2), (2, 2)], [(0, 4), (1, 4)]] passes one of your tests.

    Problem 2: My code passes all but one of your 108 tests when the tuple pairs are enclosed in a "List". Given ['TT', 'T.'] as input to your "oops all towers but one should be valid" test, my code produced [[(0, 0), (0, 1)], [(0, 0), (1, 0)]] but you were looking for [((0, 0), (0, 1)), ((0, 0), (1, 0))]. In this case, you are looking for the tuple pairs to be enclosed in a tuple instead of a List. In all other tests however, the tuple pairs are enclosed in Lists

  • Loading more items...