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 on registering move in logic #102

Open
rdeyo1129 opened this issue Jun 1, 2022 · 1 comment
Open

Question on registering move in logic #102

rdeyo1129 opened this issue Jun 1, 2022 · 1 comment

Comments

@rdeyo1129
Copy link

Hello, I was wondering if someone can speak to onMove in this snippet is being invoked instead of called with parenthesis. I wrote my own validation for this and not understanding how the move that is played on chessground gets passed into the validator such as () => onMove(from, to, promoteTo), I see this example is using chess.js. Let me know if I can clarify anything. Thanks for your time.

Ryan

<Chessground
  width="38vw"
  height="38vw"
  turnColor={turnColor()}
  movable={calcMovable()}
  lastMove={lastMove}
  fen={fen}
  onMove={onMove}
  style={{ margin: "auto" }}
/>
@rdeyo1129
Copy link
Author

rdeyo1129 commented Jun 4, 2022

After some research I see it has something to do with 0x88 board representation. However when I move a piece on the board and try logging the information being passed from that move, all I get is undefined. Is there a gotcha with 0x88 where you can't log it with javascript?

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

1 participant