Beta

#1 Step Motor Fun: Wave drive

Description
Loading description...
Algorithms
Mathematics
  • Please sign in or sign up to leave a comment.
  • Blind4Basics Avatar

    Hi again,

    as stated in your last kata, the type of the values is not currently acceptable. It leads to more problems than anything

    Cheers

  • dramforever Avatar

    Kata description looks horrible in light mode. Maybe don't do the fancy box formatting? I think it's pretty unnecessary

  • Blind4Basics Avatar

    Hi again,

    This should show up in the console:

    Log
    Start ValueError message tests
    STDERR
    .
    ----------------------------------------------------------------------
    Ran 1 test in 0.000s
    
    OK
    

    the kata is currently a total mess, about use of Decimals at some places but not at others, and the description needs a big clean up to reflect thecurrent specs. This makes the completion of the kata very annoying, right now, so I'll unpublish it to avoid users dropping downvotes on it.

    Cheers

  • Blind4Basics Avatar

    Hi,

    TypeError: unsupported operand type(s) for %: 'decimal.Decimal' and 'float'
    

    If Decimals are used in the full test suite, they also should be used in the sample tests. There aren't much things more annoying than discovering specs when you go from the sample tests to the full tests... ;)

    Cheers

  • hobovsky Avatar

    I AM VERY SORRY I missclicked and unpublished your kata back to draft. It was unintentional, please feel free to republish if you have no reason to keep it in draft state.

  • Voile Avatar

    From comments below:

    Maybe change the setup of the kata to avoid floating point errors completely? Use precise values expressed as for example fractions, decimals, or stringified decimal values, instead of binary floats?

    This is not yet resolved, the values in the input array are still floats, and hence not exact.

  • hobovsky Avatar

    Is the 3.6° step fixed for all tests, or can it be different between test cases?

  • rowcased Avatar

    This comment has been hidden.

  • 4500zenja1 Avatar

    Sometimes your solution doesn't work correctly on the random tests: for example, if you take the number 2872.8, then, because that's 798th switch to the right from the start, it corresponds to 798 => 2 => C, so it should return the sequence ending with 'C', but your solution for some reason stops BEFORE that, ending with 'B':

    position - 2872.8°, or 798th switch to the right
    ....ABCDABCDABC_BADCBA... - mine
    ....ABCDABCDAB_ADCBA...   - yours
    

    I feel like you should recheck your solution and compare its output with mine — maybe I am right and you need to rewrite a part of it, maybe I'm wrong and I need to think of smth else :/

  • 4500zenja1 Avatar

    For the test "360° turn positive direction", when we turn to 360° position, the following error happens:

    'BCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDA_' # - mine
     should equal 
    'BCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD_'  # - answer
    

    However, for the very next test, when we get to the 360° via 3.6° steps, the answer is 'B_C_D_A_..._B_C_D_A_', ending with A_, while in this test the ending is 'D_'.

    Why there are different endings for the answers if we eventually turn in the both cases to the 360°?

  • 4500zenja1 Avatar

    For sample tests, I feel like the testing on raising the ValueError can be done with the help of try-except ValueError-except-else:

    try:
        # code
    except ValueError:
        # testing that the ValueError string value is "Position x.x° can't be reached"
    except:
        # raising failed test because the error wasn't ValueError
    else:
        # raising failed test because there wasn't error at all