Research portable Memory game | Исследовать портируемую игру Память
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1008B

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