home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 451-475 / apd460 / andrew_cartwright / pools_program.amos / pools_program.amosSourceCode < prev    next >
AMOS Source Code  |  1978-02-06  |  6KB  |  227 lines

  1. Rem ******************************** 
  2. Rem *                              * 
  3. Rem *    Written by A.Cartwright   * 
  4. Rem *                              * 
  5. Rem *    I AM NEW TO PROGRAMING    * 
  6. Rem *                              * 
  7. Rem *    And This Is My First      * 
  8. Rem *                              *   
  9. Rem *     Succesful Program        * 
  10. Rem *                              * 
  11. Rem *   Feel Free to exploit the   * 
  12. Rem *                              *   
  13. Rem *   The program. I Have put    * 
  14. Rem *                              * 
  15. Rem * Rem's by the Important stuff * 
  16. Rem *                              * 
  17. Rem ******************************** 
  18. '
  19. Close Workbench : Rem these two commands save memory in case 
  20. Close Editor : Rem your machine only has half a meg 
  21. Screen Open 0,320,200,32,Lowres
  22. Track Play 8 : Rem music supplied from easy amos
  23. Track Loop On : Rem repeat music 
  24. Screen 0
  25. Double Buffer 
  26. Curs Off : Cls 0 : Hide 
  27. Get Sprite Palette 
  28. Pen 5 : Paper 0 : Centre "POOLS PROGRAM"
  29. Pen 11 : Locate ,2 : Centre "Written By Andrew Cartwright"
  30. Pen 22 : Locate ,4 : Centre "With AMOS BASIC"
  31. Pen 29 : Locate ,24 : Centre "Press Any Key"
  32. Repeat 
  33.    G$=Inkey$
  34.    Rem i have animated the man this way because i had 
  35.    Rem some complication in grabbing the images from deluxe paint 
  36.    Bob 1,100,50,1 : Wait 5 : Bob 1,108,49,2 : Wait 5
  37.    Bob 1,103,50,3 : Wait 5 : Bob 1,111,50,4 : Wait 5
  38.    Bob 1,115,50,5 : Wait 5 : Bob 1,106,50,6 : Wait 5
  39.    Bob 1,101,50,7 : Wait 5 : Bob 1,101,50,8 : Wait 5
  40.    Bob 1,100,48,9 : Wait 5 : Bob 1,103,47,10 : Wait 5
  41.    Bob 1,106,47,11 : Wait 5 : Bob 1,114,50,12 : Wait 5
  42.    Bob 1,117,49,13
  43. Until Inkey$<>"" : Rem continue until a key is pressed
  44. MAIN:
  45. Channel 0 To Screen Display 0 : Rem assign animation channel to screen 0 
  46. A$="Move 20,0,0 ; Move 0,20,5 ; Move 20,0,0 ; Move 0,-20,5;"
  47. A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
  48. A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
  49. A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
  50. A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
  51. A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
  52. A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
  53. A$=A$+"Move 20,0,5 ; Move 0,20,5 ;"
  54. Amal 0,A$
  55. Amal On : Rem Start Screen BOUNCE
  56. Wait 150
  57. Bob Off : Rem set up the next screen 
  58. Autoback 0
  59. Cls 0
  60. Ink 7 : Box 0,0 To 319,199 : Box 49,19 To 111,51 : Box 209,19 To 261,51
  61. Pen 5 : Paper 0 : Locate ,1 : Centre "Please Choose Option"
  62. Colour 2,$0 : Ink 2 : Bar 50,20 To 110,50
  63. Colour 1,$0 : Ink 1 : Bar 210,20 To 260,50
  64. Ink 5,0 : Text 52,38,"NUMBERS" : Text 220,38,"QUIT"
  65. Channel 0 To Screen Display 0
  66. B$="Move -20,0,0 ; Move 0,20,5 ; Move -20,0,0 ; Move 0,-20,5;"
  67. B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
  68. B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
  69. B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
  70. B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
  71. B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
  72. B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
  73. B$=B$+"Move -20,0,3 ; Move 0,-10,3 ;"
  74. Amal 0,B$
  75. Amal On : Rem start screen bounce
  76. Wait 100
  77. Amal Off : Rem Stop Amal PROGRAM
  78. Reserve Zone 2 : Rem reserve two zones
  79. Set Zone 1,50,20 To 110,50
  80. Set Zone 2,210,20 To 260,50
  81. Z=Zone(X,Y) : Rem  check coordinates 
  82. Show 
  83. Do 
  84.    Rem left hand zone check and action
  85.    If Mouse Zone=1 Then Colour 2,$F65 Else Colour 2,$0
  86.    Rem right side zone checkand action
  87.    If Mouse Zone=2 Then Colour 1,$F65 Else Colour 1,$0
  88.    Rem left side zone checkand action 
  89.    If Mouse Key=1 and Mouse Zone=2 Then Edit 
  90.    Rem right side zone checkand action
  91.    If Mouse Key=1 and Mouse Zone=1 Then Goto BEGIN
  92. Loop 
  93. 'stop
  94. BEGIN:
  95. Dim A(58) : Rem set up array for pools numbers 
  96. Gosub SET_SCREEN
  97. Track Stop : Rem stop music 
  98. WAIN:
  99. If Mouse Key=1 Then Cls 0 : Sam Play 7 : Wait 50 : Stop : Rem End PROGRAM  
  100. A(1)=1 : Rem allocate value to a
  101. A(2)=2
  102. A(3)=3
  103. A(4)=4
  104. A(5)=5
  105. A(6)=6
  106. A(7)=7
  107. A(8)=8
  108. A(9)=9
  109. A(10)=10
  110. A(11)=11
  111. A(12)=12
  112. A(13)=13
  113. A(14)=14
  114. A(15)=15
  115. A(16)=16
  116. A(17)=17
  117. A(18)=18
  118. A(19)=19
  119. A(20)=20
  120. A(21)=21
  121. A(22)=22
  122. A(23)=23
  123. A(24)=24
  124. A(25)=25
  125. A(26)=26
  126. A(27)=27
  127. A(28)=28
  128. A(29)=29
  129. A(30)=30
  130. A(31)=31
  131. A(32)=32
  132. A(33)=33
  133. A(34)=34
  134. A(35)=35
  135. A(36)=36
  136. A(37)=37
  137. A(38)=38
  138. A(39)=39
  139. A(40)=40
  140. A(41)=41
  141. A(42)=42
  142. A(43)=43
  143. A(44)=44
  144. A(45)=45
  145. A(46)=46
  146. A(47)=47
  147. A(48)=48
  148. A(49)=49
  149. A(50)=50
  150. A(51)=51
  151. A(52)=52
  152. A(53)=53
  153. A(54)=54
  154. A(55)=55
  155. A(56)=56
  156. A(57)=57
  157. A(58)=58
  158. Gosub SHUFFLE
  159. Gosub DEAL1
  160. Gosub DEAL2
  161. Gosub DEAL3
  162. For B=1 To 11 : Rem amount of numbers to be displayed per window 
  163.    Gosub MAINY
  164.    Gosub DEAL1 : Rem first window numbers 
  165.    Gosub DEAL2 : Rem second window numbers
  166.    Gosub DEAL3 : Rem third window numbers 
  167. Next 
  168. '
  169. Wait Key 
  170. Goto WAIN
  171. '
  172. SET_SCREEN:
  173. Screen Open 0,320,200,16,Lowres
  174. Curs Off : Flash Off : Cls 0 : Hide On 
  175. Paper 0 : Pen 5
  176. Locate ,2 : Centre "This Program Is Designed So That"
  177. Locate ,4 : Centre "The User Can Pick A Random Set Of"
  178. Locate ,6 : Centre "Numbers. From 3 Windows. If You"
  179. Locate ,8 : Centre "Want A New Set Of Numbers You "
  180. Locate ,10 : Centre "Have To Press Any Key On The"
  181. Locate ,12 : Centre "Keyboard. If You Want To Quit"
  182. Locate ,14 : Centre "Then Hold Down The Left Mouse Button"
  183. Locate ,16 : Centre "And Any Key On The Computer In"
  184. Locate ,18 : Centre "That Same Order. I Wish You Luck"
  185. Locate ,22 : Centre "PRESS ANY KEY TO START"
  186. Wait Key 
  187. Cls 0
  188. Ink 4
  189. Box 100,0 To 210,15
  190. Box 98,0 To 212,17
  191. Draw 0,0 To 320,0
  192. Ink 14,0
  193. Text 103,10,"POOLS NUMBERS"
  194. Paper 0 : Pen 5 : Wind Open 1,50,50,4,12
  195. Wind Open 2,150,50,4,12
  196. Wind Open 3,250,50,4,12
  197. Return 
  198. '
  199. SHUFFLE:
  200. For B=1 To 400 : Rem this loop mixes up all the numers  
  201.    S1=Rnd(57)+1
  202.    S2=Rnd(57)+1
  203.    S3=Rnd(57)+1
  204.    Swap A(S1),A(S2)
  205. Next B
  206. Return 
  207. '
  208. DEAL1:
  209. Inc TP : If TP>58 Then Gosub SHUFFLE : TP=1 : Rem this deals us our random numbers 
  210. NUMBER=A(TP)
  211. Return 
  212. '
  213. DEAL2:
  214. Inc TP : If TP>58 Then Gosub SHUFFLE : TP=1 : Rem this also does random numbers
  215. NUMBER1=A(TP)
  216. Return 
  217. '
  218. DEAL3:
  219. Inc TP : If TP>58 Then Gosub SHUFFLE : TP=1 : Rem and so does this 
  220. NUMBER2=A(TP)
  221. Return 
  222. '
  223. MAINY:
  224. Window 1 : Paper 0 : Pen 5 : Print NUMBER : Rem first window display 
  225. Window 2 : Pen 14 : Print NUMBER1 : Rem second window display
  226. Window 3 : Pen 15 : Print NUMBER2 : Rem third window display 
  227. Return