Created
February 23, 2025 18:00
-
-
Save mcnemesis/6b8f7deb981632dfc5f1bac88f209001 to your computer and use it in GitHub Desktop.
A TEAPA --- a simple personal assistant chatbot implemented using the TEA programming language
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/tttt -fc | |
#-------------------------------| | |
# TEAPA: TEA Personal Assistant | |
#-------------------------------| | |
# This little program is a full | |
# though simple, artificial | |
# personal assistant created | |
# using the TEA language | |
################################| | |
# set entity name | |
v:vPANAME:{PA} | |
f:^$:lSET:lNOSET | |
l:lSET | |
i:{Who do u wish to talk to? }|i: # user's entity name | |
g:|f!:^$:lSETI:lRULES|l:lSETI|v:vPANAME|j:lRULES | |
l:lNOSET | y*: | v:vPANAME # evoke invoker's entity | |
l:lRULES # show instructions | |
i!:{At any time, reply with 'end' to quit}|i: | |
v:vPROMPT:{: Talk to Me: } | |
g*:{ }:vPANAME:vPROMPT | v:vPAPROMPT | |
l:lPROMPT # prompt, get answer, process | |
y:vPAPROMPT| i: |z:| q:^end$ | |
# generate answer | |
p!:27 | s:_:13:5 | d:_.*$ | s: | a: | x!:{ | } | |
i: | j:lPROMPT # loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment