6 kyu

Moves in squared strings (IV)

67 of 1,593g964
Description
Loading description...
Algorithms
Strings
  • Please sign in or sign up to leave a comment.
  • ElYuma Avatar

    This is the easiest one if you did the other parts.

  • augmenting_ape Avatar

    This was a great warmup on spinning and flipping a matrix. Going to look at the other katas you've created because these 4 "Squared strings" were fun. Thank you!

  • Kacarott Avatar

    In prolog, attempting to load clpfd causes full tests to always timeout.

  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • tolgaersoy Avatar

    I completed to this kata series. I enjoyed while I solved to this kata series. Thank you g964.

  • trashy_incel Avatar

    Symmetry with respect to the main cross diagonal

    I believe a better name would be antidiagonal:

    https://en.wikipedia.org/wiki/Main_diagonal#Antidiagonal

  • B1ts Avatar

    You can pass Prolog tests with the exact same code from part 3.

  • B1ts Avatar

    Why is the function named diag2_sym in many other languages, but in Prolog it's diag1_sym ? :P

  • khanhtranngoccva Avatar

    Symmetry with respect to the main cross diagonal: diag_2_sym (or diag2Sym or diag-2-sym)

    diag_2_sym(s) => "plhd\nokgc\nnjfb\nmiea"
    

    It should have been the secondary diagonal.

    // Original matrix
    [ [ 'L', 'm', 'v', 'L', 'y', 'g' ],
      [ 'D', 'K', 'E', 'L', 'B', 'm' ],
      [ 'y', 'l', 'J', 'h', 'u', 'i' ],
      [ 'X', 'R', 'X', 'q', 'H', 'D' ],
      [ 'z', 'l', 'i', 's', 'C', 'T' ],
      [ 'h', 'P', 'q', 'x', 'Y', 'b' ] ]
      
    // Expected answer as I already solved this, which shows that the secondary diagonal's contents does not change.
    [ [ 'b', 'T', 'D', 'i', 'm', 'g' ],
      [ 'Y', 'C', 'H', 'u', 'B', 'y' ],
      [ 'x', 's', 'q', 'h', 'L', 'L' ],
      [ 'q', 'i', 'X', 'J', 'E', 'v' ],
      [ 'P', 'l', 'R', 'l', 'K', 'm' ],
      [ 'h', 'z', 'X', 'y', 'D', 'L' ] ]
    
  • lalfakzuala Avatar

    if you already done Moves in squared strings (III) this kata is pretty easy

  • Micromind Avatar

    Some test-cases for the julia translation might be broken:

    I need to catch calls to diag_2_symSE and rot_90_counterSE by hand and replace them with my own non-SE functions in oper, otherwise some tests throw an

    ERROR: LoadError: LoadError: MethodError: no method matching split(::Array{String,1}, ::String)
    ...
    

    in those two functions.

  • user9644768 Avatar

    Issue with Julia translation:

    1. Inconsistent module name in tests and initial solution.
    2. Are you sure you've right number of tests in julia? Because I'm timing out(passing around 238 in Julia 1.0 and 170 in Julia 1.5, please do not take the advertisement that "Julia speed in nearly to that of C" straightaway since Julia's JIT optimisation works differently in comparision to other languages, and the way it is compiled on CW renders it even slower than Python) with the solution that I used in JS, python and ruby.

    (At the time of writing this issue there is not any completions .)

  • Voile Avatar

    Random tests are missing in Rust.

    (I haven't checked every other language version, there might be some more)

  • eb110 Avatar

    Repetition is a great tool. I've already forgotten how to use higher level functions but this kata have reminded me how it works. Thanks g964.

  • donaldsebleung Avatar

    Objective-C Translation Kumited - please carefully review and approve :D

  • tygrysmalajski Avatar

    Excellent series of katas, it makes you think how to compose next functions in terms of previous ones. The problem (group actions on strings) was very interesting as well!

  • ArnoJack Avatar

    interesting training, I like:)

  • KubajsDMZ Avatar

    The last one and the best one of the series. Nice training. I enjoyed all parts of the series. Thanks ;)

  • mihdemarko Avatar

    After submitting I have these issues in console:

    ../home/codewarrior/spec.ts(1,1): error TS1084: Invalid 'reference' directive syntax. ../home/codewarrior/spec.ts(2,1): error TS1084: Invalid 'reference' directive syntax.

    May be some of the reference tags in the test cases are not self-closed?