Ad
  • Custom User Avatar

    Nice one,
    I had difficulties fixing it though.

  • Custom User Avatar

    "...create more quadrants"

    um, wat? how? anyway, it will not return a number, it will return 'None'

  • Custom User Avatar

    While it's short, what would happen if someone goes beyond inserting 12? It will return a number and create more quadrants. It might be the tidiest, shortest or even the fastest and it's quite enough for the exercise/instructions at hand, but the solution above seems to be more grounded to me.
    But at the end of the day I'm just a beginner.

  • Custom User Avatar

    This is a lot of code... You can use math or use something similar to my solution as well

  • Custom User Avatar

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

  • Custom User Avatar

    Unless performance is an issue, this code is much more readable. Any programmer can look at it and instantly tell you exactly what's going on.

  • Custom User Avatar

    I'm with you on that, this is what we might call a "naive" solution: very intuitive, but not always optimal. I haven't done any testing on these solutions but I'm certain the integer division is faster.

    I don't know why it's voted Best Practices, but sometimes that happens on some of the lower-ranked kata. (Nothing against this solution or lower-ranked users, just stating the facts)

    Also welcome! Always glad to see new people getting started with programming.