• 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
nikolovivan Avatar
Name:Ivan Nikolov
Clan:@Adthena
Member Since:Jan 2019
Last Seen:Dec 2024
Profiles:
Following:1
Followers:2
Allies:1
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (11)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • nikolovivan
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 6 years ago

    Just published another fork with 100 random tests. Feels like they would flag similar stuff as the non-random ones anyway.

  • Custom User Avatar
    • nikolovivan
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 6 years ago

    I actually did that first, but you'd still have to limit the maximum value to some number. Otherwise you might get execution timeouts.

  • Custom User Avatar
    • user8436785
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 6 years ago

    It's best to use 100 random tests.

  • Custom User Avatar
    • nikolovivan
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 6 years ago

    Also added a test with a very big number.

  • Custom User Avatar
    • nikolovivan
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 6 years ago

    Thanks Steffan153. The first comment wasn't clear at all - it makes sense now.

    Regarding the 1 random test I would completely agree in the real world! But I'm also a fan of consistency and diverging from the original translation wouldn't help anyone who wants to learn how a piece of code gets translated 1:1 from another language (test included). Changing the test makes this not a "translation" anymore. Probably the original (Java) shouldn't be allowed in the first place if that's a problem. Anyway, here is a modified version, which will test all values until 2000: https://www.codewars.com/kumite/5d4c6f84164480002b4581c8?sel=5d4c86439dbe5f001d26d1d8. I played around with the value, but going too high just makes the test time out.

  • Custom User Avatar
    • Unnamed
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 6 years ago

    And 1 random test in another translation isn't a good practice to follow...

  • Custom User Avatar
    • user8436785
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 6 years ago

    Gotcha (I think) https://www.codewars.com/kumite/5c3f6d5b460e9b408e780cfd?sel=5d4c6f84164480002b4581c8

  • Custom User Avatar
    • Unnamed
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 6 years ago

    It's public, it can be called from solutions. With more than 1 translation its name will be predictable. (If someone really wants to cheat, private isn't the panacea, but it's better than nothing.)

  • Custom User Avatar
    • nikolovivan
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 6 years ago

    Not sure what the first sentence means - isn't it private?
    Regarding tests - I literally translated the original Java kata, including the tests, making it match completely.

  • Custom User Avatar
    • Unnamed
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 6 years ago

    The reference solution be private.
    How about more than 1 random test?

  • Custom User Avatar
    • nikolovivan
    • commented on ""If you can't sleep, just count sheep!!" Scala Translation"
    • 7 years ago

    Approve, please?

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...