This commit is contained in:
Михаил Капелько
2024-05-03 15:26:51 +03:00
parent 2357062e25
commit 92acd7ec01
3 changed files with 37 additions and 0 deletions

View File

@@ -1,4 +1,6 @@
from memory_test import * from memory_test import *
from memoryCLI import *
import sys
print(memory_test_generateConstPlayfield()) print(memory_test_generateConstPlayfield())
print(memory_test_selectItem_1x()) print(memory_test_selectItem_1x())
@@ -8,3 +10,11 @@ print(memory_test_shouldDeselectMismatchedItems())
print(memory_test_shouldDeselectMismatchedItems_itemTwice()) print(memory_test_shouldDeselectMismatchedItems_itemTwice())
print(memory_test_shouldDetectVictory()) print(memory_test_shouldDetectVictory())
print(memory_test_shouldHideMatchingItems()) 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
v4/memoryCLI.py Normal file
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
v4/memoryCLI_Context.py Normal file
View File

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