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

Add skeleton classes Chess and Move #160

Merged
merged 13 commits into from
Oct 9, 2023
Merged

Add skeleton classes Chess and Move #160

merged 13 commits into from
Oct 9, 2023

Conversation

madcpf
Copy link
Collaborator

@madcpf madcpf commented Oct 5, 2023

Add initial version of class QuantumChineseChess, which

  • inits, prints welcome info, gets players' preferences;
  • loops over to apply players' move;
  • checks end conditions.

Add initial version of file move, which

  • checks if the input string could be parsed into locations on chess boards;
  • turn those locations into move and apply it.

@madcpf madcpf marked this pull request as draft October 5, 2023 21:49
@madcpf madcpf requested a review from dstrain115 October 6, 2023 17:37
@madcpf madcpf marked this pull request as ready for review October 6, 2023 17:37

def game_over(self) -> int:
"""
Checks if the game is over.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Usually you put the first line with the triple quotes. This usually looks better in the IDE.

"""Checks if the game is over.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Doug. It's fixed.

Currently the pytest fails with error:
E ModuleNotFoundError: No module named 'mock'

, while locally I installed package mock and all tests pass. How may I install this module in the online repository?

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 9, 2023 03:32
Copy link
Collaborator

@dstrain115 dstrain115 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some final comments, then LGTM

@madcpf madcpf merged commit abcd518 into quantumlib:main Oct 9, 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