Михаил Капелько 7 months ago
parent
commit
92acd7ec01
3 changed files with 37 additions and 0 deletions
  1. +10
    -0
      v4/main.py
  2. +20
    -0
      v4/memoryCLI.py
  3. +7
    -0
      v4/memoryCLI_Context.py

+ 10
- 0
v4/main.py View File

@@ -1,4 +1,6 @@
from memory_test import *
from memoryCLI import *
import sys

print(memory_test_generateConstPlayfield())
print(memory_test_selectItem_1x())
@@ -8,3 +10,11 @@ print(memory_test_shouldDeselectMismatchedItems())
print(memory_test_shouldDeselectMismatchedItems_itemTwice())
print(memory_test_shouldDetectVictory())
print(memory_test_shouldHideMatchingItems())

c = memoryCLI_createContext()
c = memoryCLI_greetUser(c)
print(c.output)

for line in sys.stdin:
ln = line.rstrip()
print(f"you entered: '{ln}'")

+ 20
- 0
v4/memoryCLI.py View File

@@ -0,0 +1,20 @@
from memoryCLI_Context import *
from llm import *

# Greet the user.
#
# Conditions:
# 1. No input is present (the app just got launched)
@llm_by_value
def memoryCLI_greetUser(
c: memoryCLI_Context
) -> memoryCLI_Context:
if (
c.input == ""
):
c.output = "OGS Memory TextUI greets you, %USERNAME%. Let's play!"
c.recentField = "output"
return c
c.recentField = "none"
return c
#}

+ 7
- 0
v4/memoryCLI_Context.py View File

@@ -0,0 +1,7 @@
class memoryCLI_Context:
def __init__(self):
self.input = ""
self.output = ""

def memoryCLI_createContext():
return memoryCLI_Context()

Loading…
Cancel
Save