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

Question about Move.withPromotion #72

Closed
niklasf opened this issue Apr 25, 2016 · 1 comment
Closed

Question about Move.withPromotion #72

niklasf opened this issue Apr 25, 2016 · 1 comment

Comments

@niklasf
Copy link
Member

niklasf commented Apr 25, 2016

I am a bit confused by https://github.com/ornicar/scalachess/blob/master/src/main/scala/Move.scala#L62.

  1. When will it ever return None?
  2. Shouldn't it return None, when attaching a promotion to a move that did not (and can not) have one?
@ornicar
Copy link
Collaborator

ornicar commented Apr 28, 2016

  1. when after take dest or b2.place(color - p, dest) returns None
  2. if the move wasn't promoting (if ((after count color.queen) > (before count color.queen)) then the move is returned unchanged. Option only represents failure to underpromote.

@ornicar ornicar closed this as completed Apr 28, 2016
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