oops, i forgot the code
wordmax = 200
dim wordlist$(wordmax)
do
c=0
print "Welcome to the learning AI program!"
print "Please choose one:"
print "1.Teach"
print "2.Learn"
input ">>",choose
if choose=1
print "Ok, teach me!"
print "Please put your sentence in this format:"
print "The [noun] is [adjective]."
input ">>",str$
lastword = ReadWords(str$,"")
lastword = ReadWords(str$,".")
open to write 1,"data.txt"
sync
for t=0 to wordmax
if c=1 then write string 1,wordlist$(t) : c=0
if c=2 then write string 1,wordlist$(t) : c=0
if wordlist$(t)="The" then c=1
if wordlist$(t)="is" then c=2
next t
close file 1
cls
endif
if choose=2
cls
print "Ok, I will teach you!"
print "Reading data..."
m=0
do
inc m
open to read 1,"data.txt"
read string 1,noun$
dim noun$(f)
read string 1,adjective$
dim adjective$(f)
if noun$(f)="" or adjective$(f)="" then exit
loop
for a=1 to m/2
print "The ",noun$(a)," is ",adjective$(m),", and the",noun$(a+1)," is ",adjective$(a+1),"."
next a
endif
loop
end
function ReadWords(s$, filter$)
rem --- s$ = string to be processed
rem --- filter$ = characters to be removed
for i = 0 to wordmax : wordlist$(i)="" : next i
ln = len(s$) : if ln = 0 then exitfunction 0
lf = len(filter$)
wrd$ = "" : pos = 0
index = -1
repeat
inc pos,1
lett$ = mid$(s$,pos)
if lett$ = " " or pos > ln
if wrd$<>""
index = index + 1
wordlist$(index) = wrd$
wrd$=""
endif
else
filt = 0
for f = 1 to lf
if mid$(filter$,f) = lett$ then filt = 1
next f
if filt = 0 then wrd$ = wrd$ + lett$
endif
until pos > ln
endfunction index
Whatever I did it wasn't me!