Ad
  • Custom User Avatar

    The problem is I never solved a Rubik's cube in my life. I don't even understand basic patterns to move a piece from A to B without moving other pieces.

  • Custom User Avatar

    You should explain this:

    (100ms/solve)

    • Is that for one test, or all tests?
    • Do you measure the time we need to find the moves, or the time needed to run those moves on a solved cube?
  • Custom User Avatar

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

  • Custom User Avatar

    I can only do that after I have solved the kata.

  • 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

    why can't you edit them?

  • 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

    Rank inflation is a thing to consider too

    This is a selffulling propecy. Skrew this inflation :)

  • 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

    Your 2x2 kata is probably also 4, no?

  • Custom User Avatar

    Those shouldn't be deleted, even if it were possible. Once published, your submission is part of the historical record.

  • Custom User Avatar

    oh my bad, give me a second to fix it

    done.

  • Loading more items...