OPEN "o",#1,"sine3.dat"
screen=XBIOS(3)+31998
a$=""
count=200
a=0
b=0
c=0
fact=60
aon$="y"
bon$="n"
con$="n"
y=0
WHILE a$=""
  y=y+1
  IF y=200
    y=0
  ENDIF
  tota=(SIN(a*5))*fact
  totb=SIN(b*3)*fact
  totc=SIN(c)*fact/4
  IF bon$="n"
    totb=0
    b=0
  ENDIF
  IF con$="n"
    totc=0
    c=0
  ENDIF
  x=(tota+totb+totc)/2
  x=INT(x)
  PLOT x+160,y
  POKE screen,x
  BPUT #1,screen,1
  a=a+0.01
  b=b+0.02
  c=c+0.2
  a$=INKEY$
  SELECT a$
  CASE "b"
    bon$="y"
    a$=""
  CASE "c"
    con$="y"
    a$=""
  ENDSELECT
WEND
' now get back to the middle
IF x>0
  num=-1
ENDIF
IF x<0
  num=1
ENDIF
WHILE x<>0
  x=x+num
  POKE screen,x
  BPUT #1,screen,1
  PLOT x+160,y
WEND
CLOSE #1
