Ad
  • Default User Avatar

    you are absolutely correct, using a pattern as static variable is about 3-4 times faster.

  • Default User Avatar

    closed. not an issue; description clarifies board size.

  • Default User Avatar

    closed. not an issue.

  • Default User Avatar

    i thought that the adapted description would make things clear enough so it would't be a bother.
    However, if most people think it would be much better to have a standard size board, this can be changed.
    Also, feel to edit the tests if you like.
    The number of pieces (like, having possibly more than 2 knights) i would leave though as this could possibly happen by promotion anyhow.

  • Default User Avatar

    updated the description to make this more clear.

  • Default User Avatar

    im sorry that was not meant to be annoying at all but i thought that the principle of knight moves and finding forks had nothing to do with the standard size of the board or the standard piece setup.

  • Default User Avatar

    thanks for the edits!
    I can edit the description but cant save edits to the tests anymore. neither by republishing nor by unpublish save then republish. gave up on that.

  • Default User Avatar

    it should always be uppercase. description adapted.

  • Default User Avatar

    EDIT: editor stopped working. no more changes possible. any ideas?

    cant > Well, ok, there is something unnatural to your current class

    I removed the constructor to simplify and reduce the description. Explaining how the solver has to code a class and what the constructor does only detracts. Also, the position and player turn are both input data and therefore to my mind should go into the method. This leaves the solver free to use an instance variable for the board, or pass the board (possibly changed with piece moves) to helper functions.

    other than that, some tips:

    done.

    EDIT: btw: put all the needed keywords in each method,

    done.

  • Default User Avatar
  • Default User Avatar

    Thank you for your comments!

    • description rewritten, markups added, image of board added
    • return type changed to Set
    • method names changed
    • failure messages fixed

    I'm still unhappy with the formatting of the failure messages, but I don’t know how to fix that.

  • Default User Avatar

    only when in the first string.
    in the replacement string, it refers (together with the following number) to the group caught by the parentheses in the first string: $1 -> first group, $2 -> second group... see g.g. http://users.cs.cf.ac.uk/Dave.Marshall/Internet/NEWS/regexp.html