home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / boyan1.zip / ETCH.BSC < prev    next >
Text File  |  1989-02-01  |  2KB  |  36 lines

  1. \\ Sample script to turn BOYAN into an Etch-a-Sketch!
  2.  
  3. \\ This script is fairly advanced, demonstrating the following techniques:
  4. \\ 1. Cursor movement and screen control
  5. \\ 2. Saving the beeps & bells toggle for later restoring
  6. \\ 3. Reading and testing user input
  7. \\ 4. Separating a script into blocks: START, DRAW, and EXIT
  8.  
  9.  
  10. |START
  11. \ZS                       \\ clears screen
  12. \ST[ Welcome to BOYAN Etch-A-Sketch! ]   \\ status message
  13. \SV3[%BB]                 \\ saves current beeps&bells value in variable 3
  14. \BB-                      \\ turns beeps&bells off
  15. \KO[60]                   \\ set keyboard timeout to 60 seconds
  16. \GX[40]\GY[12]            \\ start in the middle of the screen (40,12)
  17.  
  18.  
  19. |DRAW
  20. \DM1,1[<I>=up│<J>=left│<K>=right│<M>=down│<X>=exit   ]
  21. \DM1[│ X-position = %XP │ Y-position = %YP ] \\ display status on line 1
  22. \KV1_[Your Etch-a-sketch command? ]          \\ get char input from keybd
  23. \DM%XP,%YP[ ]             \\ display a space at current x,y cursor posn
  24. \IV1+I[\RY[-1]]           \\ move up if input="I"
  25. \IV1+J[\RX[-1]]           \\ move left if input="J"
  26. \IV1+K[\RX[1]]            \\ move right if input="K"
  27. \IV1+M[\RY[1]]            \\ move down if input="M"
  28. \IV1+X[\GB[EXIT]]         \\ go to "EXIT" block if input="X"
  29. \DM%XP,%YP[▒]             \\ display a shaded block at cursor position
  30. \GB[DRAW]                 \\ loop back for more input!
  31.  
  32.  
  33. |EXIT
  34. \IE+%V3,ON[\BB+]          \\ turn beeps&bells back on if they were on before
  35. \GX[1]\GY[24]             \\ leave cursor on bottom line of screen
  36.