Ad
  • Custom User Avatar

    good luck then! (unless you don't want to do my kata, of course)

  • Custom User Avatar
  • Custom User Avatar

    I have no idea, every time I change the example test cases in editor and press "publish", the changes aren't made in the trainer itself. I do have the code for the correct sample test code, written below though. If you, or someone else would help change the sample tests to this, that would be really appreciated.

    from solution import solve
    import codewars_test as test
    from preloaded import *
    
    @test.describe("sample scrambles:")
    def tests():
        def do_test(i, scramble):
            @test.it(f"fixed scramble #{i}: {scramble}")
            def _():
                cube = apply_moves(create_copy(SOLVED_CUBE), scramble)
                orig_cube, save_cube = create_copy(cube), create_copy(cube)
                solution = solve(cube).strip()
                apply_moves(orig_cube, solution)
                if is_solved(orig_cube):
                    test.pass_()
                else:
                    print(f'failed solve.\n\nscramble: {scramble}\n{cube_net(save_cube)}\n\nyour solution: {solution}\n\nresulting state:\n{cube_net(orig_cube)}')
                    test.fail('')
    
        scrambles = [
            "L F2 R' B U' D2 U2 F B' D B2 L B' L' F'",
            "D2 F2 R' F' B' R' U' D2 F' D2 F L2 D2 U' L",
            "R2 F B2 R F U' R2 F R D B2 U2 D2 F R",
            "B' U2 D R2 F D' L D U2 F2 U2 B F2 L' D",
            "F2 R' L F2 R U F2 R B' F D2 L2 F' D' F'"
        ]
        
        for i, scramble in enumerate(scrambles, 1):
            do_test(i, scramble)
    
  • Custom User Avatar

    22-12-2024

    sorry, the example test code is wrong and I can't edit them, but the actual test cases do; please press 'attempt' instead of 'test' to test your solution.

    thank you,

    • goldenratio161

    (reiterated in description)

  • Custom User Avatar

    you make a good point, dfhwze. changed to 4kyu.

  • Custom User Avatar

    agreed, call it "Rubik's Cube simulator" maybe?

  • Custom User Avatar

    ah, maybe I should change it to 4kyu. However the 3x3 solver it estimated at 3kyu only, and the my 2x2 one is much easier imo. Rank inflation is a thing to consider too... Oh well, maybe I should get more completions on my kata first, then let the community decide.

  • Custom User Avatar

    oh my bad, give me a second to fix it

    done.

  • Custom User Avatar

    man, another banger problem dude. absolutely loved it, it was incredibly rewarding to finally solve this.

  • Custom User Avatar

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

  • Custom User Avatar

    damn, it looks like we had the same idea but you executed it way cleaner, nice job!

  • Custom User Avatar

    glad you enjoyed it, and thanks for doing my kata man! Your solution looks really clean btw, and yeah, at least for me, this kata (and the series in general) wasn't as easy as I thought it was. (also partially because I cannot understand regular expressions for the life of me).

  • Custom User Avatar

    hey, dfhwze, thank you so much for approving my kata! I have just changed the description, does it look better now?

  • Custom User Avatar

    yup, it is the size of the grid, and i think maybe it's just a little more readable that way.

  • Custom User Avatar

    oh damn, that is a much cleaner version of my solution

  • Loading more items...