47 lines
1.1 KiB
Plaintext
47 lines
1.1 KiB
Plaintext
arraybase 1
|
|
blocks$ = "BO,XK,DQ,CP,NA,GT,RE,TG,QD,FS,JW,HU,VI,AN,OB,ER,FS,LY,PC,ZM"
|
|
makeWord$ = "A,BARK,BOOK,TREAT,COMMON,SQUAD,Confuse"
|
|
b = int((length(blocks$) /3) + 1)
|
|
dim blk$(b)
|
|
|
|
for i = 1 to length(makeWord$)
|
|
wrd$ = word$(makeWord$,i,",")
|
|
dim hit(b)
|
|
n = 0
|
|
if wrd$ = "" then exit for
|
|
for k = 1 to length(wrd$)
|
|
w$ = upper(mid(wrd$,k,1))
|
|
for j = 1 to b
|
|
if hit[j] = 0 then
|
|
if w$ = left(word$(blocks$,j,","),1) or w$ = right(word$(blocks$,j,","),1) then
|
|
hit[j] = 1
|
|
n += 1
|
|
exit for
|
|
end if
|
|
end if
|
|
next j
|
|
next k
|
|
print wrd$; chr(9);
|
|
if n = length(wrd$) then print " True" else print " False"
|
|
next i
|
|
end
|
|
|
|
function word$(sr$, wn, delim$)
|
|
j = wn
|
|
if j = 0 then j += 1
|
|
res$ = "" : s$ = sr$ : d$ = delim$
|
|
if d$ = "" then d$ = " "
|
|
sd = length(d$) : sl = length(s$)
|
|
while true
|
|
n = instr(s$,d$) : j -= 1
|
|
if j = 0 then
|
|
if n = 0 then res$ = s$ else res$ = mid(s$,1,n-1)
|
|
return res$
|
|
end if
|
|
if n = 0 then return res$
|
|
if n = sl - sd then res$ = "" : return res$
|
|
sl2 = sl-n : s$ = mid(s$,n+1,sl2) : sl = sl2
|
|
end while
|
|
return res$
|
|
end function
|