7 kyu

Thinkful - Object Drills: Quarks

2,471 of 3,863Grae-Drake
Description
Loading description...
Fundamentals
Object-oriented Programming
  • Please sign in or sign up to leave a comment.
  • hhhscvx Avatar

    for what in examples q1.color should output color of q1, in my solution it doesn`t work but tests all passed

  • jdold07 Avatar

    Half of what the description requests is never tested. Yet almost all of the submitted solutions appear to have known not to worry about handling valid colours, flavours or assigning the bayron_number to the class and not to each object. How???

  • slowly_coding Avatar

    This comment has been hidden.

  • akar-0 Avatar
  • nomennescio Avatar

    Factor translation: adapt description for interact; it's not a method, nor is it named .interact

  • awesome333 Avatar

    Can someone explain this line? self.color, other.color = other.color, self.color

  • oldcoder Avatar

    nice one,educational...thks

  • tri@ Avatar

    Factor translation (author inactive)

  • diggi55 Avatar

    Published a java translation, looking for feedback :)

  • diggi55 Avatar

    Suggestion: Remove valid color and valid flavor from the description.

    Looking at zebulans issue that was resolved 5 years ago, a decision was made to not test for color nor flavor. We should rephrase the corresponding paragraph to avoid further confusion :)

  • Lucasss Avatar

    Nice educational kata.

  • ejini战神 Avatar

    Python new test framework should be used with 3.8 enabled

  • jebreen Avatar

    Ruby translation, please review and approve!

  • Souzooka Avatar

    C# translation Kumited, please review and approve.

  • Dalachowsky Avatar

    Any chance for C++ version?

  • zebulan Avatar

    @Grae-Drake,

    I noticed a few minor issues with your kata:

    • You aren't testing invalid inputs even though your description seems to imply you will. This could be fixed by telling the user to raise an error and making sure they do with a few test.expect_error(message, thunk) tests. Codewars Docs

      • The only colors and flavors you are testing with are all valid. I removed the parts that raised errors in my own solution and it still passes.
      • You also aren't checking invalid input (aka non-Quark) being passed to interact
    • You are missing a period in one of the examples in your description: >>> q2 color should be >>> q2.color

    • You aren't properly handling Python 2's floor division. In Python 2, 1 / 3 == 0 (floor division by default). You could either make at least one of the numbers a float, 1 / 3.0 or you could use operator.truediv(1, 3) which works for both Python 2 & 3.

    • You aren't actually using my_Quark in your tests. If you had, you might have noticed that the baryon_number in it is 1 / 4 (which is also 0 in Python 2).

    Thanks!

  • ZozoFouchtra Avatar

    JS translation kumited. ; ) )