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.

35 lines
986B

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