Ad
  • Default User Avatar

    No one with same problems after five months?

  • Default User Avatar

    Don't know if there is an issue in JS. I see 195 has completed the kata in JS so i guess i'm skipping something.

    Case 1: Some times, i correctly get 'Game Over!' several plays but seems that game restart at some point. Instructions does not inform about restarting game.

    Case 2: Some times, test does not take in consideration double die

    Player 1 takes 1 and 4
    Player 1 before move is at: 97
    Player 1 after move is at: 98
    Test Passed: Value == 'Player 1 is on square 98'
    Log
    Player 2 takes 1 and 1
    Player 2 before move is at: 75
    Player 2 after move is at: 77
    Test Passed: Value == 'Player 2 is on square 77'
    Log
    Player 2 takes 6 and 3
    Player 2 before move is at: 77
    Player 2 after move is at: 86
    Should return: Player 1 is on square 9 - Expected: 'Player 1 is on square 9', instead got: 'Player 2 is on square 86'

    As you see, player 2 takes dobles 1, so he should play again, but test expected player 1 to play.

    Case 3: Game suddenly restarts with no winners???

    Log
    Player 1 takes 4 and 5
    Player 1 before move is at: 84
    Player 1 after move is at: 93
    Test Passed: Value == 'Player 1 is on square 93'
    Log
    Player 2 takes 3 and 4
    Player 2 before move is at: 86
    Player 2 after move is at: 93
    Test Passed: Value == 'Player 2 is on square 93'
    Log
    Player 1 takes 5 and 6
    Player 1 before move is at: 93
    Player 1 after move is at: 96
    Should return: Player 1 is on square 11 - Expected: 'Player 1 is on square 11', instead got: 'Player 1 is on square 96'

    Here, player 1 should bounce, but it seems to begin again from 0

  • Default User Avatar

    Nice to stop the loop if necessary ;)

  • Default User Avatar

    Did similar using while to stop the loop

  • Default User Avatar

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

  • Default User Avatar

    Taking first word as the shortest word (it's correct) you can skip the first loop iteration initializing i as '1' instead of '0'. Now you're comparing the first word with itself.

  • Default User Avatar

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

  • Default User Avatar

    The good thing about using objects in JS, is that you can use it as a map. Name atributes in your object will be the 'key' of the map.