Skip to content

bug in valid-moves #3

@kindlychung

Description

@kindlychung

There is a bug here:
https://github.com/flyingmachine/pegthing/blob/master/src/pegthing/core.clj#L98-L100

Should be:

(defn valid-moves
  "Return a map of all valid moves for pos, where the key is the
  destination and the value is the jumped position"
  [board pos]
  (into {}
        (filter (fn [[destination jumped]]
                  (and (not (pegged? board destination))
                       (pegged? board jumped)
                       (pegged? board pos)))
                (get-in board [pos :connections]))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions