Advertisement
shedarshian

chess

Feb 21st, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. game
  2. ┣name: string. The name of the game.
  3. ┣chessboard: dict. Discribe the chessboard.
  4. ┃┣pic: string. The path of the pic used for the chessboard.
  5. ┃┣shape: string. "square" or "custom".
  6. ┃┣chess_pos: string. optional. For type "custom", evaluate the position of chess's pic using the chess's param_pos.
  7. ┃┃ When evaluating expression, "self" stands for the current chess. Returns a tuple contains x, y.
  8. ┃┣begin_pos_x: float. optional.
  9. ┃┣begin_pos_y: float. optional. For type "square", stands for the left-up corner of the using area.
  10. ┃┣interval_x: float. optional.
  11. ┃┗interval_y: float. optional. For type "square", stands for the interval of the chess's pic.
  12. ┣parse: string. Evaluate to parse the user input to get the command for chess logic.
  13. ┃ When evaluating expression, "i" stands for the input string, "chess_list" stands for a list of all chess.
  14. ┣chess: dict. Discribe the chess.
  15. ┃┃ Properties: "chess.param_pos": Tuple[float, ...]. Stands for the params that can determine the pos of the chess.
  16. ┃┃ "chess.type": string. Stands for the type name of the chess.
  17. ┃┃ "chess.param": Tuple[Union[int, float, string], ...]. Stands for the floating params for the chess.
  18. ┃┃ Member function: "chess.changePic(i)" can be called to change pic.
  19. ┃┃ "chess.suicide()" can be called to remove itself.
  20. ┃┃ "chess.moveTo(*param_pos)" can be called to move to the specified pos.
  21. ┃┣pics: list of string. The path of the pic list used for chess.
  22. ┃┣types: list of type of chess.
  23. ┃┃┣name: string. name of the type.
  24. ┃┃┣slots: list of member functions.
  25. ┃┃┃┣name: string. The name of member function. "chess.name(*args)" will call this function.
  26. ┃┃┃┗lambda: string. The lambda of the function. "args[n]" stands for the input args when calling this function.
  27. ┃┃┗pic_init: int. Initial pic chosen for this type.
  28. ┃┗
  29. ┗timeline: dict. Discribe the timeline of the game.
  30. symbols allowed in expression:
  31. + - * / % ** & | ^ == != < <= > >= = += -= *= /= %= &= |= ^= [ ] ( ) . , : if else for in raise
  32. public function:
  33. AddChess(type)
  34. Randint(begin, end)
  35. Rand()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement