Research portable Memory game | Исследовать портируемую игру Память
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

memory_Context.py 1008B

6 个月前
5 个月前
6 个月前
5 个月前
6 个月前
5 个月前
5 个月前
5 个月前
6 个月前
1234567891011121314151617181920212223242526272829303132333435
  1. class memory_Context:
  2. def __init__(self):
  3. self.didLaunch = False
  4. self.exit = False
  5. self.hiddenItems = []
  6. self.input = ""
  7. self.mismatchedItems = []
  8. self.outputGoOn = ""
  9. self.outputGreeting = ""
  10. self.outputHelp = ""
  11. self.outputMatchedItems = ""
  12. self.outputMismatchedItems = ""
  13. self.outputPromptSelection = ""
  14. self.outputVictory = ""
  15. self.playfieldItems = {}
  16. self.playfieldSize = 0
  17. self.recentField = "none"
  18. self.selectedId = -1
  19. self.selectedItems = []
  20. self.victory = False
  21. def field(self, fieldName):
  22. return getattr(self, fieldName)
  23. def setField(self, fieldName, value):
  24. setattr(self, fieldName, value)
  25. def __repr__(self):
  26. return self.__str__()
  27. def __str__(self):
  28. return f"memory_Context(playfieldI/playfieldS/recentF/selectedId/selectedI: '{self.playfieldItems}'/'{self.playfieldSize}'/'{self.recentField}'/'{self.selectedId}'/'{self.selectedItems}')"
  29. def memory_createContext():
  30. return memory_Context()