• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
codeunshackled Avatar
Name:Unknown
Clan:Unknown
Member Since:Sep 2016
Last Seen:Oct 2018
Profiles:
Following:2
Followers:0
Allies:0
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations
  • Replies (4)
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • anter69
    • commented on "Clay Pigeon Shooting" ruby solution
    • 7 years ago

    Although you can easily index an array with -1, 0, 1 too...

  • Custom User Avatar
    • bestwebua
    • commented on "Permutations" kata
    • 9 years ago

    I think main idea of this kata is write own method like .permutation.

  • Custom User Avatar
    • junthecoder
    • commented on "Clay Pigeon Shooting" ruby solution
    • 9 years ago

    First, <=> operator returns -1, 0, or 1.

    i.e.) scores[:P2] <=> scores[:P1] returns
    -1 if scores[:P2] < scores[:P1]
     0 if scores[:P2] == scores[:P1]
     1 if scores[:P2] > scores[:P1]

    Because array index starts from 0, adding 1 is necessary to make a correct index (0, 1, or 2).

  • Custom User Avatar
    • g964
    • commented on "Is my friend cheating?" kata
    • 9 years ago

    You don't need matrices.

  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...