Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in valid-moves #3

Open
kindlychung opened this issue May 21, 2015 · 1 comment
Open

bug in valid-moves #3

kindlychung opened this issue May 21, 2015 · 1 comment

Comments

@kindlychung
Copy link

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]))))
@nando
Copy link

nando commented Aug 11, 2020

Thanks Keenz!!

nando added a commit to nando/pegthing that referenced this issue Aug 11, 2020
By Keenz (@kindlychung at Github.com*). Thanks!!
* flyingmachine#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants