Ad
  • Custom User Avatar

    It is a funny Kata, and it made me find out about Exceptions that I've never encountered yet.
    Much harder than I thought at first, especially if you forget about The easiest way of making Kotlin throw a RuntimeException and try to exploit java interop.

  • Custom User Avatar

    Sure, here it is. Note that I reworked it several times trying to get it work with floats, and I tried to restore the first version. So it might lack some special cases, but the main idea is present.

    fizzledCalculator x 1 z = x < z
    fizzledCalculator 1 y z = y < z
    fizzledCalculator 0 y z = 0 < z
    fizzledCalculator x 0 z = 0 < z
    fizzledCalculator x y 0 = (x>0 && y<0) || (x<0 && y>0)
    fizzledCalculator x y z
      | y<0 = not (fizzledCalculator (-x) (-y) (-z)
      | otherwise fizzledCalculator x (y-1) (z-y)
    
  • Custom User Avatar

    Can anyone give a clue on the task?
    I know how to solve the task for integers, but no idea on how to deal with floats...

  • Custom User Avatar

    I don't insist that you change the kata, after all it's your course. But I can't agree with you. I don't think it's good when you write something in one language because it might be necessary in another one, especially because it will still look different in other language and because when you are switching to some other language, You will need to get used to its syntax and all. And people get used to thinking about datatypes after they get several Type Errors (and I think it's better to let students make their own errors, at least in this case). Avoiding variable remaining uninitialiized in case of errors is a good point, but a) this should be mentioned then and b) usually you check your input first and do calculation after passing all checks.

  • Custom User Avatar

    Please remove "variable declarations". I mean things like a = 0 before a = int(input("some question ")). It is unnecessary and makes code less readable. If you are trying to make a course of Python, you should explain, that one should not 'declare' variable before assignment.

  • Custom User Avatar

    third testcase is broken, it misses 'types('

  • Custom User Avatar

    Hi. Python also uses snake_case instead of camelCase. Fix please.

  • Custom User Avatar

    http://www.codewars.com/kata/generating-permutations/python — itertools.permutations are somehow blocked. May be @electricjay could tell how to do it...

  • Custom User Avatar

    I don't know. I'm almost sure I've seen some katas with blocked import, I just can't remember what was it, otherwise I could look at test cases there, or something...
    I tihnk, there should be some way to get function code, then you can check for word 'import' in it.

  • Custom User Avatar

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

  • Custom User Avatar

    In Pyton snake_case should be used instead of camelCase

  • Custom User Avatar

    Thanks, it took several days to deal with all edge cases, but it was a pleasure to have this kata solved. I did really enjoyed the whole series.
    And thank you for explanation. Now I see where I was wrong. But I still think, this should be mentioned in description (all this thing about non-integer rates and so on), because it isn't obvious.
    I think I'll rework my solution now to avoid that horrible workaround.

  • Custom User Avatar

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

  • Custom User Avatar

    Hi. Great set of katas, it was niice to master them all. But there is a problem with messages with overall bit per time unit rate of 2. I've found that in these messages '1111' is considered to be dot (so, it's '11', just bit longer) and '0000' is considered to be one space (so it's '000000', just a bit shorter). It took rather long time to find this thing, and I've found no mentions about such thing possible. And also haven't find any good way to handle these cases correctly (I think that my handling of it is rather ugly).
    So I suppose this should be either fixed or mentioned in description.

  • Custom User Avatar

    Well, as long as you can only publish solution if it passes all tests, I think we can assume that all code is correct. So if we have two solutions which arecompiled OK and pass all tests, and these solutions only differ in quotes used... Well, I think it's obviously same solution. At least I can't imagine same solution working both with chars and strings (if it's different types).

  • Loading more items...