Post by bluatigro on Jun 20, 2018 19:08:05 GMT
start of a expert system
what you can fil whit your own knowledge
save and load wil be added next
what you can fil whit your own knowledge
save and load wil be added next
global cardmax
cardmax = 8
dim Q$( cardmax )
global now$
[main.menu]
print "bluatigro 20 jun 2018"
print "presents : expert 1.0"
print "1 : program expert ."
print "2 : run expert ."
print "3 : load card's ."
print "4 : save card's ."
print "5 : quit expert ."
input "choise [ 1 , 2 , 3 ] = " ; in$
in = val( in$ )
if in < 1 or in > 3 then goto [menu]
if in = 1 then gosub [program]
if in = 2 then gosub [run]
if in = 3 then gosub [save]
if in = 4 then gosub [load]
if in = 5 then end
goto [main.menu]
function nr( card$ )
length = len( card$ )
x = cardmax
for i = 1 to length
if mid$( card$ , i , 1 ) = "y" then
uit = uit + x
end if
x = x / 2
next i
nr = uit
end function
[program]
now$ = ""
[program.menu]
print "now = " ; now$
if nr( now$ ) > cardmax then goto [main.menu]
print "programming expert ."
print "1 : fill card ."
print "2 : goto yes card ."
print "3 : goto no card ."
print "4 : go 1 card back ."
print "5 : end ."
input "choise [ 1 ... 5 ] = " ; in$
in = val( in$ )
select case in
case 1
input "input card : " ; in$
Q( nr( now$ ) ) = in$
case 2
if right$( Q( nr( now$ ) ) ) <> "?" then
print "ERROR : not a question card !!"
else
now$ = now$ + "y"
end if
case 3
if right$( Q( nr( now$ ) ) ) <> "?" then
print "ERROR : not a question card !!"
else
now$ = now$ + "n"
end if
case 4
if nr( now$ ) = 0 then
print "ERROR : root card !!"
else
now$ = left$( now$ , len( now$ ) - 1 )
end if
case 5
goto [main.menu]
case else
print "ERROR : wrong choise !!"
end select
goto [program.menu]
[run]
now$ = ""
[run.loop]
print "run expert ."
a$ = Q( nr( now$ ) )
print a$
if right$( a$ , 1 ) = "?" then
in = 0
while in <> 1 and in <> 2
print "1 : yes ."
print "2 : no ."
input "choise [ 1 , 2 ] = " ; in$
in = val( in$ )
wend
if in = 1 then now$ = now$ + "y"
if in = 2 then now$ = now$ + "n"
goto [run.loop]
else
input "[ push return ]" ; in$
end if
goto [main.menu]
[save]
print "save card's is not jet there ."
goto [main.menu]
[load]
print "load card's is not jet there ."
goto [main.menu]