# Digit Span# epstej@mail.dmh.state.mo.usnew#get length10 o=fn(42)12 t=100013 input "How many numbers (2-20)",x15 if x<2 or x>20 then 10#get direction16 input "Forward or Backward (f/b)", x$17 if x$ = "f" then goto 2018 if x$ = "b" then goto 2019 goto 16# generate string20 y$=""25 for i=1 to x27 z=rnd(10)28 o=fn(42):gosub ((z+1)*100)29 gosub 9030 o=fn(42)31 gosub 9032 if x$="f" then y$=y$+str$(z)33 if x$="b" then y$=str$(z)+y$35 next i40 t=250#get guess50 input "Enter your guess",x$# compare55 if x$=y$ then 7056 sound 440,100,64:gosub 9057 sound 340,500,64:gosub 9060 ? "Nope: "+y$65 goto 8070 sound 440,100,64:gosub 9071 sound 440,100,64:gosub 9072 sound 500,500,64:gosub 9075 ? "Congratulations, You Won!"80 input "Play Again? (y/n)",x$81 if x$="y" then 1088 end90 for j=1 to t:next j:return100 grline 40,20,80,120,7101 grline 60,40,40,80,-7:return200 grline 70,20,20,120,7:return300 grline 40,20,80,120,7301 grline 40,40,60,40,-7302 grline 60,100,60,20,-7:return 400 grline 40,20,80,120,7401 grline 40,40,60,80,-7402 grline 70,70,30,20,7:return500 grline 40,20,80,120,7501 grline 40,80,60,60,-7502 grline 60,20,40,40,-7:return600 grline 40,20,80,120,7601 grline 60,40,60,20,-7602 grline 40,80,60,40,-7:return700 grline 40,20,80,120,7701 grline 60,40,60,20,-7702 grline 60,80,40,40,-7:return800 grline 40,20,80,120,7801 grline 40,40,60,100,-7:return900 grline 40,20,80,120,7901 grline 60,40,40,30,-7902 grline 60,90,40,30,-7:return1000 grline 40,20,80,120,71001 grline 60,40,40,20,-71002 grline 40,80,60,40,-7:returnrun