home *** CD-ROM | disk | FTP | other *** search
/ Explore the World of Soft…ids, Adults, Educational / RocelcoInc-ExploreTheWorldOfSoftware-KidsAdultsEducational-Vol2-Shareware.iso / educate / disk061 / bear123.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1986-08-10  |  3.6 KB  |  110 lines

  1. 10  '                     B E A R 1 2 3 . B A S         8/10/86 11:20 pm
  2. 20  '
  3. 30  '   BEARY FUN COUNTING helps a child with counting and with locating numbers
  4. 40  ' on the keyboard.  It displays a random number of fruit on the screen and
  5. 50  ' waits patiently until the proper number is pressed. For each correct answer
  6. 60  ' a bear face is placed on the border of the screen
  7. 70  ' The game continues until the border is filled with bears.
  8. 80  '
  9. 90  '    Converted for IBM-PC Screen 1.
  10. 100  '
  11. 110   SCREEN 1 : CLS : COLOR 0,0
  12. 120  LOCATE 6,10 : PRINT "BEARY FUN COUNTING";
  13. 130  LOCATE 24,1 : PRINT "  copyright 1985, Computing Specialties";
  14. 140  '
  15. 150  '
  16. 160  '         Poke subroutine ALOAD into memory.
  17. 170  '
  18. 180  DEF SEG : ALOAD= 48000
  19. 190  FOR IB=0 TO  95 : READ BYTE : POKE ALOAD+IB,BYTE : NEXT IB
  20. 200  DATA &H55, &H8B, &HEC, &H8B, &H5E, &H0A, &H8A, &H0F, &HB5, &H00, &H8B, &H77
  21. 210  DATA &H01, &H8B, &H5E, &H08, &H8B, &H07, &H8E, &HC0, &HBF, &H00, &H00, &HA4
  22. 220  DATA &HE2, &HFD, &HB0, &H00, &HAA, &H1E, &H06, &H1F, &H07, &HB0, &H00, &HB4
  23. 230  DATA &H3D, &HBA, &H00, &H00, &HCD, &H21, &H72, &H24, &H8B, &HD8, &HB9, &H07
  24. 240  DATA &H00, &HBA, &H00, &H00, &HB4, &H3F, &HCD, &H21, &H3B, &HC1, &H74, &H05
  25. 250  DATA &HB8, &H0D, &H00, &H75, &H0F, &HBE, &H05, &H00, &H8B, &H0C, &HB4, &H3F
  26. 260  DATA &HBA, &H00, &H00, &HCD, &H21, &HB8, &H00, &H00, &H8B, &H7E, &H06, &H26
  27. 270  DATA &H89, &H05, &HB4, &H3E, &HCD, &H21, &H06, &H1F, &H5D, &HCA, &H06, &H00
  28. 280  '
  29. 290  '           Load the title picture onto the screen.
  30. 300  '
  31. 310  SEG2%=&HB800 : BERR%=0 : FILE$="BEAR1231.PIC" : CALL ALOAD(FILE$,SEG2%,BERR%)
  32. 320  '
  33. 330  '     get the pictures into arrays.
  34. 340  '
  35. 350  DIM CHERRY(100),ORANGE(100),PINEAPPLE(100),BANANA(100),APPLE(100),BEAR(400)
  36. 360  DIM X(9),Y(9) : FOR I=1 TO 9 : READ X(I),Y(I) : NEXT I : DATA 60,45,140,45,220,45,60,90,140,90,220,90,60,135,140,135,220,135
  37. 370  GET (154,91)-(168,105),CHERRY
  38. 380  GET (191,88)-(204,99),ORANGE
  39. 390  GET (225,72)-(239,99),PINEAPPLE
  40. 400  GET (200,60)-(210,74),BANANA
  41. 410  GET (167,66)-(184,80),APPLE
  42. 420  GET (77,76)-(100,98),BEAR
  43. 430  FOR I=1 TO 3000 : NEXT I
  44. 440  '
  45. 450  '   Start the game.
  46. 460  '
  47. 470  RANDOMIZE TIMER
  48. 480  REM
  49. 490  LINE (0,0)-(319,199),2,B
  50. 500  LINE (30,30)-(289,169),3,B
  51. 510  LINE (31,31)-(288,168),0,BF
  52. 520  '
  53. 530  '   Pick a number from 1 to 9 and one of the fruits.
  54. 540  '   Then place that many fruit on the screen.
  55. 550  '
  56. 560  N=INT(RND*9)+1
  57. 570  FRUIT=INT(RND*5)+1
  58. 580  IF N>=4 THEN I=1:GOSUB 900
  59. 590  IF N>=7 THEN I=2:GOSUB 900
  60. 600  IF N>=4 THEN I=3:GOSUB 900
  61. 610  IF N=2 OR N=3 OR N=6 OR N=8 OR N=9 THEN I=4:GOSUB 900
  62. 620  IF N=1 OR N=3 OR N=5 OR N=7 OR N=9 THEN I=5 : GOSUB 900
  63. 630  IF N=2 OR N=3 OR N=6 OR N=8 OR N=9 THEN I=6 : GOSUB 900
  64. 640  IF N>=4 THEN I=7 : GOSUB 900
  65. 650  IF N>=7 THEN I=8 : GOSUB 900
  66. 660  IF N>=4 THEN I=9 : GOSUB 900
  67. 670  WHILE INKEY$<>"" : WEND
  68. 680  '
  69. 690  '   Wait until the proper number key is pressed.  (Quit if Q is pressed.)
  70. 700  '
  71. 710  R$=INKEY$
  72. 720  IF R$=CHR$(27)  THEN RUN"MENU
  73. 730  IF R$<>CHR$(48+N) THEN 710
  74. 740  '
  75. 750  '   The correct key was pressed, add a happy bear face to the border.
  76. 760  '
  77. 770  NB=NB+1
  78. 780  XB=(NB-1)*32+3 : YB=3
  79. 790  IF NB>10 THEN XB=292 : YB=(NB-10)*35+3
  80. 800  IF NB>14 THEN XB=3 : YB=(NB-14)*35+3
  81. 810  IF NB>18 THEN YB=173 : XB=(NB-19)*32+3
  82. 820  PUT(XB,YB),BEAR,PSET
  83. 830  SOUND 115+NB*5,1:SOUND 350+NB*5,1:SOUND 756+NB*5,1:SOUND 1036+NB*5,1:SOUND 1435+NB*5,1
  84. 840  FOR T=1 TO 100 : NEXT T
  85. 850  IF NB=28 THEN GOTO 990
  86. 860  GOTO 510
  87. 870  '
  88. 880  '   Subroutine to plot a piece of fruit at position I.
  89. 890  '
  90. 900  ON FRUIT GOTO 910,920,930,940,950
  91. 910  PUT (X(I),Y(I)),CHERRY : RETURN
  92. 920  PUT (X(I),Y(I)),ORANGE : RETURN
  93. 930  PUT (X(I),Y(I)),PINEAPPLE : RETURN
  94. 940  PUT (X(I),Y(I)),BANANA : RETURN
  95. 950  PUT (X(I),Y(I)),APPLE : RETURN
  96. 960  '
  97. 970  '   The screen is full of bears, congratulate the kid.
  98. 980  '
  99. 990  LOCATE 10,19 : PRINT "YAY!"
  100. 1000  LOCATE 16,16:PRINT "YOU DID IT!"
  101. 1010  FOR T=1 TO 10 : SOUND 1435,1 : SOUND 1100,1 : NEXT T
  102. 1020  '
  103. 1030  '   Reset the game and go back for a new one.
  104. 1040  '
  105. 1050  R$=INKEY$ : IF R$<>"" THEN 1050
  106. 1060  FOR I=1 TO 3000 : NEXT I
  107. 1070  CLS : NB=0
  108. 1080  GOTO 480
  109. 1090  END
  110.