Research portable Memory game | Исследовать портируемую игру Память
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

54 строки
1.4KB

  1. from cli import *
  2. from cli_test import *
  3. from memory_test import *
  4. from Controller import *
  5. #from shell import *
  6. #import sys
  7. print(memory_test_deselectMismatchedItems())
  8. print(memory_test_deselectMismatchedItems_itemTwice())
  9. print(memory_test_detectVictory())
  10. print(memory_test_generateConstPlayfield())
  11. print(memory_test_hideMatchingItems())
  12. print(memory_test_selectItem_1x())
  13. print(memory_test_selectItem_2x())
  14. print(memory_test_selectItem_3x())
  15. print(cli_test_greetUser())
  16. #print(cli_test_selectItem())
  17. #print(cli_test_shouldPromptSelection())
  18. ##print(cli_test_shouldReportIvalidItemSelection_outOfBoundsMin())
  19. #print(cli_test_showHelp_h())
  20. #print(cli_test_showHelp_help())
  21. ctrl = Controller(memory_createContext())
  22. ctrl.registerFunction(cli_greetUser)
  23. ctrl.registerFunction(cli_showHelp)
  24. ctrl.registerCallback(lambda c: print(f"ИГР App.dbg ctx: '{c}'"))
  25. def printOutput(c):
  26. if c.recentField.startswith("output"):
  27. print(getattr(c, c.recentField))
  28. ctrl.registerCallback(printOutput)
  29. #
  30. #c = shell_createContext()
  31. #c.cCLI = cli_createContext()
  32. #c.cCLI.cMemory = memory_createContext()
  33. #c.cCLI.cMemory.playfieldSize = 2
  34. #c.cCLI.cMemory = memory_generateConstPlayfield(c.cCLI.cMemory)
  35. #
  36. #c = shell_launch(c)
  37. #print(c.output)
  38. #
  39. #for line in sys.stdin:
  40. # c.input = line.rstrip()
  41. # c = shell_processInput(c)
  42. # if c.exit:
  43. # break
  44. # print(c.output)
  45. ctrl.set("didLaunch", True)