• Sign Up
  • Kata
  • Kumite
  • Forum
  • Wiki
  • Leaders
  • Log In
  • Sign Up
Name:Unknown
Clan:Unknown
Member Since:Apr 2014
Last Seen:Jun 2015
Profiles:
Following:0
Followers:0
Allies:0
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (30)
  • Replies
  • Authored
  • Needs Resolution
    • sonovagibs
    • commented on "You're a square!" ruby solution

    Im curious as to why we do not need to specify return "false" or "true" in this example?

    • juliangalardi
    • commented on "You're a square!" ruby solution

    Math is allowed, what you are getting is:
    "Math::DomainError (Numerical argument is out of domain - "sqrt")"
    you could use 'raise' to attend it or use logical expression to ensure the positive range of the number before use Math::sqrt

    • juliangalardi
    • commented on "You're a square!" ruby solution

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

    • KULKING
    • commented on "You're a square!" ruby solution

    Thanks for mentioning. I am new on this platform and didn't know the purpose of spoiler flag. Now I knnow. Thanks :)

    • Chrono79
    • commented on "You're a square!" ruby solution

    Use spoiler flag, please.

    • KULKING
    • commented on "You're a square!" ruby solution

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

    • KULKING
    • commented on "You're a square!" ruby solution

    You get this error when you pass a negative value to Math.sqrt. You can't pass negative to it.

    • FunkyQChicken
    • commented on "You're a square!" ruby solution

    i agree, for example 1e16+1 returns true when it shouldn't

    • cyril-lemaire
    • commented on "Largest 5 digit number in a series" ruby solution

    @Wei-LiangChew I'm a little late but then the while loop will iterate over with n - 1 = 8 (and so on)

    • siddharthkrish
    • commented on "You're a square!" ruby solution

    hmm.. i kept getting sqrt error. not sure why. thought Math.sqrt isn't supported here.

    • Naypam
    • commented on "You're a square!" ruby solution

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

    • Wei-LiangChew
    • commented on "Largest 5 digit number in a series" ruby solution

    But what if the largest 5-digit number in digits doesn't start with 9?

    • ReganRyanNZ
    • commented on "Snail" ruby solution

    This is better than using array.shift because it leaves array unaltered.

    Or do variables duplicate when put as arguments anyway?

    • maalur
    • commented on "Re-open class" kata

    I'm going to say the same thing others have said...
    I don't think it makes sense to disallow the use of alias_method if they aren't creating a unique method. This asks users to create an alias for a method while preventing them from using best practices. For newer programmers this could potentially teach them bad practices or confuse them on what the best practices are.

    I recommend allowing the use of alias_method if the goal is to have users alias a method, or have them add a simple method like String#first or String#last to return the first or last character.

    • maalur
    • commented on "Largest 5 digit number in a series" ruby solution

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

  • Loading more items...
  • © 2021 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Contact
  • powered by

Confirm

  • Cancel
  • Confirm