• Custom User Avatar

    It is a static method. it is called on the uninstansiated class, not the object created from the class

  • Custom User Avatar
  • Custom User Avatar

    just state scissors is 2 fingers and paper 5

  • Custom User Avatar

    One possible answer is given in the docs https://docs.codewars.com/authoring/tutorials/create-first-kata

    Basically, there is no easy answer as to how to create a good task. Rather, there is a vast list of "don't's":

    • don't be repetetive, as many ideas have already been implemented: just solve more to see that;
    • don't make user perform additional dull actions to complete it. For example, in your last kata, it was about clearing additional spaces;
    • don't make description a mind flow; come up with a description, which is clear and understandable. Imagine, as if your grandma should understand it. User should be able to understand the task without looking at the sample tests (except puzzle katas, maybe);
    • don't just use floats: if you design the task about numbers, always pick up appropriate number type from the math point of view. Choose between int (bigint), fractions, decimal, and only as the last resort floats.

    As to how come up with original ideas, it's a difficult question. There are different types of katas, and some users come up with ideas more often than others. Consider, for example, math olympics tasks. Such tasks may appear as sudden intermediate step in some math work. Many ideas come from life. Again, as you solve more katas and get more experience, you will know more and you will start notice more things, which in turn will stimulate your imagination further.