• 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
seasidetesting Avatar
Name:Stephan Kämper
Clan:Unknown
Skills:software testing, ruby, oceanography, physics
Member Since:Sep 2015
Last Seen:Jun 2025
Profiles:
Following:4
Followers:15
Allies:4
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations
  • Replies
  • Authored (99)
  • Needs Resolution
  • Custom User Avatar
    • seasidetesting
    • commented on "Playing with cubes II" ruby solution
    • 2 months ago

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
    • seasidetesting
    • commented on "Squeaky Window" ruby solution
    • 12 months ago

    Thanks! That's why we're here right? Learning something new.

  • Custom User Avatar
    • seasidetesting
    • commented on "The Feast of Many Beasts" ruby solution
    • 17 months ago

    That's because (in Ruby and many other languages) you can use an integer to get to the n-th charactetr in a String just as you can get the n-th element of an Array.
    You can think of a String as an ordered list of charscters (technically code points, but thats another story).

  • Custom User Avatar
    • seasidetesting
    • commented on "Sort rectangles and circles by area II" ruby solution
    • 2 years ago

    I didn't claim it would be.
    However… if anywhere, I think it's acceptable especially in a narrow use case, such as a coding exercise. THe reason: Precisely because it's a narrow use case, it won't cause harm elsewhere.

    That said, using refinements would have been a cleaner way to achieve the effect, without reopening standard classes.

    In a real system that deals with geometrical objects, I'd expect that each of these objects would respond to area anyway.

  • Custom User Avatar
    • seasidetesting
    • commented on "Safen User Input Part I - htmlspecialchars" ruby solution
    • 3 years ago

    The plain reason is: Because the tests fail without this, as spaces & a few other characters match the regular expression.

    I didn't know why, when I wrote this solution (and and to think about it for a while, now that you've asked your question. A very good question!

    Now I know: The regex character class contains too many characters. The regex should be written more like this:

    /[#{REPLACEMENTS.keys.join}]/
    

    With this regular expression the method becomes even simpler, because the || match isn't needed anymore.

    That was a really good catch! Thanks for asking – and Happy hacking. 🧑‍💻

  • Custom User Avatar
    • seasidetesting
    • commented on "More Zeros than Ones" ruby solution
    • 4 years ago

    Thanks! 🙏🏼

  • Custom User Avatar
    • seasidetesting
    • commented on "Even or Odd - Which is Greater?" ruby solution
    • 5 years ago

    Brilliant. …
    Barely comprehensible, but brilliant!

  • Custom User Avatar
    • seasidetesting
    • commented on "Make the Deadfish swim" ruby solution
    • 5 years ago

    Thank you.

    Yes, I did.
    I sometimes pick a technique or approach for a kata first and then use that to solve the problem.
    (This is nothing you'd do in code for production, where you look for the best approachs to solve a problem.)

    Sometimes it's interesting to see how solutions emerge from a given technique.
    In this case it's the way method_missing is used to deal with part of the problem.

  • Custom User Avatar
    • seasidetesting
    • commented on "Most valuable character" ruby solution
    • 5 years ago

    Nice!
    The only change I'd make is to replace split('') with chars, and — maybe — call first instead of [0].

  • Custom User Avatar
    • seasidetesting
    • commented on "Sort Out The Men From Boys " ruby solution
    • 6 years ago

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
    • seasidetesting
    • commented on "L1: Set Alarm" ruby solution
    • 6 years ago

    I'd like to add that not adding the 'return' is more idiomatic Ruby (& also following the Ruby style guide, see https://rubystyle.guide/#no-explicit-return).

  • Custom User Avatar
    • seasidetesting
    • commented on "Find the stray number" ruby solution
    • 6 years ago

    Good point. Thanks!

  • Custom User Avatar
    • seasidetesting
    • commented on "Quarter of the year" kata
    • 6 years ago

    Agreed: Since the description mentions that only valid input will be used and the tests being exhaustive (i.e. checking all months in a year), random tests aren'T needed.

  • Custom User Avatar
    • seasidetesting
    • commented on "A Strange Trip to the Market" ruby solution
    • 6 years ago

    In cases ilke this, I mostly put the parentheses in to remind myself about the precedence of the '' (in partucular).

  • Custom User Avatar
    • seasidetesting
    • created an issue for "Greatest Common Divisor Bitcount" kata
    • 7 years ago

    For the Ruby version the method name should've followed Rubyy's naming convention and be binary_gcd, instead of BinaryGCD (which, given the first character is upper case indicates a constant or class.

  • Loading more items...
  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...