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

Implement classical moves and rule checks #162

Merged
merged 12 commits into from
Oct 17, 2023
Merged

Conversation

madcpf
Copy link
Collaborator

@madcpf madcpf commented Oct 10, 2023

In Board:

  • add path_pieces() to return the classical and quantum pieces in the path;
  • add flying_general_check() to check if two KINGs meet directly.

In Chess:

  • add check_classical_rule() to check if the move is classically allowed;
  • add classify_move() to classify moves into MoveTypes and MoveVariants;
  • update apply_move() to apply the classical moves.

In Enums:

  • update MoveType to remove the redundant move types.

In Piece:

  • add reset() to set the classical attributes of the piece.

@madcpf madcpf marked this pull request as draft October 10, 2023 18:53
@madcpf madcpf requested a review from dstrain115 October 11, 2023 06:22
@madcpf madcpf marked this pull request as ready for review October 11, 2023 06:22
unitary/examples/quantum_chinese_chess/chess.py Outdated Show resolved Hide resolved
unitary/examples/quantum_chinese_chess/chess.py Outdated Show resolved Hide resolved
unitary/examples/quantum_chinese_chess/chess.py Outdated Show resolved Hide resolved
unitary/examples/quantum_chinese_chess/chess.py Outdated Show resolved Hide resolved
unitary/examples/quantum_chinese_chess/chess.py Outdated Show resolved Hide resolved
@madcpf madcpf requested a review from dstrain115 October 13, 2023 05:44
@madcpf madcpf merged commit dd269b5 into quantumlib:main Oct 17, 2023
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants