Research portable Memory game | Исследовать портируемую игру Память
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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()