Bulls and cows: Difference between revisions

m
Line 7,502:
 
function checkinput(s)
dim c(10)
bu=0:co=0
if len(s)<>4 then checkinput=-1 :exit function
for i=1 to 4
b=mid(s,i,1)
if c(asc(b)-48)<>0 then checkinput=-1 :exit function
c(asc(b)-48)=1
if instr("0123456789",b)=0 then checkinput=-1 :exit function
for j=1 to 4