home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / gwbasic / spiele / menu.bas < prev    next >
Encoding:
BASIC Source File  |  1991-05-15  |  4.5 KB  |  84 lines

  1. 10 REM ============================= ADX008 =================================
  2. 20 REM This program presents a menu of the programs available on this     ===
  3. 30 REM diskette and allows the user to select a program by moving the     ===
  4. 40 REM cursor to the desired program and pressing ENTER.                  ===
  5. 50 REM ======================================================================
  6. 60 REM  Turn off KEY display, set display width, clear the screen and set ===
  7. 70 REM KEY(10) to reload this menu program when pressed in command mode. ===
  8. 80 REM =====================================================================
  9. 90 KEY OFF:WIDTH 80:CLS
  10. 100 REM $s2
  11. 110 REM =====================================================================
  12. 120 REM Display the menu of the programs available on this diskette.      ===
  13. 130 REM =====================================================================
  14. 140 LOCATE 1,37,0:COLOR 0,7:PRINT " ADX008 ";
  15. 150 LOCATE 3,10:COLOR 7,0:PRINT "The following programs are available on this diskette:";
  16. 160 LOCATE 5,30:PRINT "Reading Program"
  17. 170 LOCATE 6,30:PRINT "Mastermind"
  18. 180 LOCATE 7,30:PRINT "Math program"
  19. 190 LOCATE 8,30:PRINT "Frankenstein"
  20. 200 LOCATE 9,30:PRINT "Game of Nim"
  21. 210 LOCATE 10,30:PRINT "Backgammon"
  22. 220 LOCATE 11,30:PRINT"Blackjack"
  23. 230 LOCATE 12,30:PRINT"Trucker"
  24. 240 LOCATE 13,30:PRINT "IQ Builder"
  25. 245 LOCATE 14,30:PRINT "Exit to BASIC"
  26. 250 LOCATE 18,1:PRINT"Use the ";:COLOR 15:PRINT"UP ("CHR$(24)")";:COLOR 7:PRINT" and ";:COLOR 15:PRINT"DOWN ("CHR$(25)")";:COLOR 7:PRINT" arrows to position the cursor to the function"
  27. 260 LOCATE 19,1:PRINT"desired and then press the ";:COLOR 15:PRINT"ENTER ("CHR$(17)CHR$(196)CHR$(217)")";:COLOR 7:PRINT" key."
  28. 270 REM =====================================================================
  29. 280 REM Set up the initial coordinates for the selection arrow.           ===
  30. 290 REM =====================================================================
  31. 300 X=25:Y=5
  32. 310 REM =====================================================================
  33. 320 REM Set up UP and DOWN arrows for moving selection arrow.             ===
  34. 330 REM =====================================================================
  35. 340 KEY(11) ON:KEY(14) ON:ON KEY(11) GOSUB 610:ON KEY(14) GOSUB 680
  36. 390 REM =====================================================================
  37. 400 REM Display highlighted selection arrow at Y,X.                       ===
  38. 410 REM =====================================================================
  39. 420 COLOR 15:LOCATE Y,X:PRINT "==>";
  40. 430 POKE 106,0'clear kybd buffer
  41. 440 REM =====================================================================
  42. 450 REM If ENTER is pressed, go to program run routine.                   ===
  43. 460 REM =====================================================================
  44. 470 REM $s2
  45. 480 IF INKEY$ = CHR$(13) THEN BEEP:COLOR 7:CLS:GOTO 750
  46. 490 REM $s2
  47. 500 REM =====================================================================
  48. 510 REM Display the date and time at the bottom of the display.           ===
  49. 520 REM =====================================================================
  50. 530 REM $s2
  51. 540 COLOR 7:LOCATE 25,25:PRINT DATE$,TIME$;
  52. 550 GOTO 420
  53. 560 REM $pa
  54. 570 REM =====================================================================
  55. 580 REM Move the selection arrow up if it isn't at the top of the menu.   ===
  56. 590 REM =====================================================================
  57. 600 REM $s2
  58. 610 BEEP:Y1=CSRLIN:X1=POS(0):LOCATE Y,X:PRINT "   ";:LOCATE Y1,X1:IF Y>5 THEN Y=Y-1
  59. 620 RETURN 420
  60. 630 REM $s2
  61. 640 REM =====================================================================
  62. 650 REM Move the selection arrow down if it isn't at the top of the menu. ===
  63. 660 REM =====================================================================
  64. 670 REM $s2
  65. 680 BEEP:Y1=CSRLIN:X1=POS(0):LOCATE Y,X:PRINT "   ";:LOCATE Y1,X1:IF Y<14 THEN Y=Y+1
  66. 690 RETURN 420
  67. 700 REM $s2
  68. 710 REM =====================================================================
  69. 720 REM Run the selected program. If selection is invalid, return to menu.===
  70. 730 REM =====================================================================
  71. 740 REM $s2
  72. 750 IF Y=5 THEN RUN "reading"
  73. 760 IF Y=6 THEN RUN "master"
  74. 770 IF Y=7 THEN RUN "math"
  75. 780 IF Y=8 THEN RUN "frank"
  76. 790 IF Y=9 THEN RUN "nim"
  77. 800 IF Y=10 THEN RUN "backgam"
  78. 810 IF Y=11 THEN RUN "black"
  79. 820 IF Y=12 THEN RUN "trucker"
  80. 830 IF Y=13 THEN RUN "iqbuild"
  81. 835 IF Y=14 THEN STOP
  82. 840 BEEP:LOCATE 2,1:PRINT "Please make another selection."
  83. 850 FOR I=1 TO 1000:NEXT I:RUN
  84.