Ad
  • Custom User Avatar

    already raised as issue

  • Custom User Avatar

    Can data be transferred as numbers or a list?

  • Custom User Avatar

    This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/121.
    Please join the discussion to help us identify duplicate kata and retire them.

  • Default User Avatar

    Really nice initiation and practice to those unfamiliar with class construction. Thanks for the kata!

  • Default User Avatar

    Thanks sooo much! After adding the == method, everything worked well!

  • Default User Avatar

    I got the same problem.
    Make sure to implement the __eq__(equal) method correctly, the v1==v2 method.

  • Default User Avatar

    I am stuck in this challenge. Would be really grateful if someone can direct me. Having these errors
    Expected: #<Vector:0x000056332da9c0c0 @coordinates=[1, 2, 3]>, instead got: #<Vector:0x000056332da9c1b0 @coordinates=[1, 2, 3]> from the creation test and
    Expected: #<Vector:0x000056332da92a98 @coordinates=[0, 0, 0]>, instead got: #<Vector:0x000056332da92b60 @coordinates=[0, 0, 0]>
    Expected: #<Vector:0x000056332da92598 @coordinates=[2, 4, 6]>, instead got: #<Vector:0x000056332da92688 @coordinates=[2, 4, 6]>
    from the addition & subtraction tests
    I know the objects id's does not match but I am creating a new object on both methods

  • Custom User Avatar

    Description of the kata did not state that a tuple can be passed as an argument however in the random test, a tuple was passed instead of a list.
    Vector([a,b,c]) # creates a new Vector from the supplied 3D array. Vector(a,b,c) # same as above

  • Default User Avatar

    Answer to myself and maybe others:

    The tests do not want to compare the instances, as they (hopefully) are always different.
    Take care of this early and all will be fine :)

  • Default User Avatar

    Maybe this was the same error I'm running into:

    Test.assert_equals(Vector.new(1,2,3), Vector.new([1,2,3]))

    yields

    #<Vector:0x0000559eb6bc3b08 @x=1, @y=2, @z=3>, instead got: #<Vector:0x0000559eb6bc3f68 @x=1, @y=2, @z=3>

    in my implementation, although the initialization itselfs seems to do, what it is supposed to.

  • Custom User Avatar

    Yes, using getter and setter is a better way. But that is not what this kata asks for.

  • Default User Avatar

    Thank you.

  • Custom User Avatar
  • Custom User Avatar

    The exact same question was answered in the third post below yours.

  • Custom User Avatar

    Magnitude is not a method, it should be implemented as a property.

  • Loading more items...