用QBASIC实现“百叶窗”

Author: 袁庆 Date: 1997-01-01

  UCDOS的DEMO制作很新颖,每显示完一屏,便会出现象百叶窗式的翻页,这一过程是怎样实现的呢?下面的这个QBASIC小程序也能产生这种效果。该程序在多种机型上调试通过。
  ’叶片横放
  SCREEN 12
  FOR a=0 TO 20
  IF INKEY$=CHR$(27) THEN END
  b=640:c=20
  FOR e=0 TO 24
  LINE (0,e*c)-(b,a+e*c),15,BF
  NEXT
  NEXT
  ’叶片纵放
  SCREEN 12
  LINE (0,0)-(640,480),15,BF
  FOR a=0 TO 20
  FOR e=0 TO 32
  IF INKEY$=CHR$(27) THEN END
  c=20:d=0:
  LINE (e*c,0)-(a+e*c,480),d,BF
  NEXT
  NEXT