-
Legal actions are represented as numbers. For example, a pawn move from a2 to a3 is represented as the number 89. This is a problem because I cannot tell what the move was from the number only. Any suggestions, explanations? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
C++ or python? You can always use State::ActionToString(int player, Action action) to get a string representation of the action. In Python, this would look like |
Beta Was this translation helpful? Give feedback.
-
Is there any way to get the coordinates of the piece that would be taking the action? |
Beta Was this translation helpful? Give feedback.
-
Yep, you can use and then the Move struct (whose definition is in chess_board.h) has the info you are looking for. It'd help to answer the C++ vs. Python question if you have more follow-up questions; the answer for Python is that the function and data type is not exposed to Python (but can be easily added). I can offer to add this to show you how to add your own. |
Beta Was this translation helpful? Give feedback.
-
Those attributes are what I am looking for. How can I use that function in Python? |
Beta Was this translation helpful? Give feedback.
-
I have changed my mind, that would be a very messy function. I am going to build from source, I would highly appreciate you exposing and syncing it. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Thank you! |
Beta Was this translation helpful? Give feedback.
C++ or python?
You can always use State::ActionToString(int player, Action action) to get a string representation of the action. In Python, this would look like
state.action_to_string(player, action)
.