Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • Thanks, that clears it up.

  • So I'm interpreting the above as one track going straight up, and the other track moving diagonally then horizontally when intersecting, then diagonally again. Is that correct?

    Yes. e.g.

       | /               |             /
      /+/  is same as    |   plus   /-/
     / |                 |         /
    

    So there aren't any instances where a diagonal part of the track intersects with a horizontal or vertical part like below?

    No. e.g.

        |/               |                  /       
        |   is same as   |  (ok) plus      |   (invalid)
       /|                |                /         
    
    
        |/               |                  / 
        +   is same as   |  (ok) plus      +   (invalid)
       /|                |                /
    
    

    But curiously, I think the same shape track with a station would be OK

        |/               |                  /
        S  is same as    S   (ok) plus     S  (ok)
       /|                |                /
    
  •   | /
     /+/
    / |
    

    So I'm interpreting the above as one track going straight up, and the other track moving diagonally then horizontally when intersecting, then diagonally again. Is that correct?

    So there aren't any instances where a diagonal part of the track intersects with a horizontal or vertical part like below?

      |/       |/
      |        +
     /|   or  /|
    
  • Python translation awaiting approval.

  • Ok, I checked out your code. The problem is you're using a global variable solution, which gets mutated with every test run.

  • Check to see if your solution is mutating values. Other reputable users have solved this kata without issue, so it seems likely the problem is with your code. Also, if you want people to read your code, you need to use proper markdown formatting.

  • I'm getting this when I run for the second pre test, pre_test_1[[0, 1, 1], [0, 5, 1], [5, 7, 1], [7, 0, 0], [1, 1, 1]] should equal [[4, 3, 0], [0, 5, 1], [5, 7, 1], [7, 0, 0], [1, 1, 1]]

    But when I run it on my machine I am getting:

    [[4, 3, 0], [0, 5, 1], [5, 7, 1], [7, 0, 0], [1, 1, 1]], which is the correct solution. That is why I am claiming you have a bug in your testing.

    My code may not be optimal yet, but it is correct for every test that I have tried so far. Note that it is only the first element of the array that is different between the solution created in CodeWars and the solution produced on my box. I'm using
    Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32

  • Added random tests :)

  • It's a good concept for a kata and worth the while. I'll give that chameleon one a gander, too. 🖖

  • That looks excellent :-) I checked the description, all good. You're right, it did look weird in this view, looks like it's because the HTML bits are ignored.
    Thank you again, you might want check out the Card-Chameleon kata ;-)

  • Thank you very much!

  • Some notes about this translation:

    • For some reason the description looks odd in this view, but when viewed under the editor, it appears fine. @Zwyx, you may want to double-check the description markdown to make sure it appears as intended (that is, you may want to check it after approving the translation).
    • This translation is based off and mirrors the Python translation
    • The only real difference is with the random test generator for the decode test cases. In the original Python translation, invalid tests were made by creating "short decks" (decks w/ size < 52). In this elixir translation, the random tests were improved by making decks invalid using 3 different methods:
      • making a short deck
      • including duplicate cards
      • including invalid cards (e.g. "q$","wV",etc.)
  • you might want to mention that about x being the row number, but thanks I'm sure that will help.

  • Loading more items...