6 kyu

Finding Arrows in a String

247 of 394skidd
Description
Loading description...
Strings
  • Please sign in or sign up to leave a comment.
  • ahmet_popaj Avatar

    Nice kata to exercise pattern matching with.

  • akar-0 Avatar

    I am asking this as a question, since I don't know if I have missed something or there is an unclear specification: how should be treated =<=>? Two valid arrows (=< and =>) or a sequence of value 0 (= -> 0 + <=> -> double ended arrow, so 0 two),

  • mychal Avatar

    The initial Test works, but the Attempt always fails and I am not able to decipher what could be wrong. By all my best knowledge: I coded my solution exactly according to the written description - hence the Test works fine.

    It would be helpful if the StackTrace contained also the inputs, not just the output and expected output. This way we are kept too much in dark, I only see: testAdvanced()
    expected: <-2> but was: <4>

    testRandom()
    expected: <33> but was: <34>
    expected: <42> but was: <44>
    ... and many other different combinations.

    Would it be possible to display the input values of the testAdvanced(), so that I would see that maybe I am missing something from the Description ?

  • Nazar.Kriv09 Avatar

    How to calculate this ? '>===>->' == [>] [==>] [->] -> 9 Do I make mistake somewhere ?

  • slahucka Avatar

    Can someone explain how is this input >>><.=<=<..=<> -3. I'm still getting -9. thanks

    > 1
    > 1
    > 1 
    <.= -4
    <= -4
    <..= -4
    
  • Sh1bari Avatar

    The string will only contain the characters ., -, =, <, >. assertEquals(11, ArrowSearch.searchArrows("-1")); how I need to understand this?

  • trashy_incel Avatar
  • trashy_incel Avatar

    at least in Python, there are no fixed / sample tests with = and - being adjacent, e.g.:

    <---===

    <-=-=->

  • koba1996 Avatar
  • Expurple Avatar
  • eurydice5717 Avatar

    IMHO You should append the description: seems that in your tests the tail length is caped to 2 max (==) or some value and couldn't see that in the description..

    Thus I coded for any length of arrow, such as "<===========".

    Also give some hints regarding the tests size (small/medium/large)

  • ilash Avatar
  • Voile Avatar

    Actual tests should at least contain every sample test. Currently it consists of a completely different set of tests.

    Also, the fixed tests in actual tests do not have a mixture of arrows and . together. They only exists in random tests.

  • Voile Avatar

    Random tests do not have the correct testing framework usage (about describe and it): See https://docs.codewars.com/languages/python/codewars-test

  • Voile Avatar

    Initial code has arrow_game but sample tests has arrow_search. Which one is correct?