home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0950.lha / BBDoors / BBDoors65.lha / rexxDoors / One_Armed_Bandit.rexx < prev    next >
OS/2 REXX Batch file  |  1993-08-06  |  8KB  |  321 lines

  1. /***************************************/
  2. /* Bandit.rexx  Slot Machine Simulator */
  3. /* By: James M. Cates III Oct. 8 1990  */
  4. /* Arexx V1.10 By: William Hawes       */
  5. /* Original                            */
  6. /* Game Bye: M. Soucy and M. Fox.      */
  7. /* I found the code heavily 'munged'   */
  8. /* So, I did this. It works.           */
  9. /***************************************/
  10. /*  Altered again for BBBBS:rexxDoors  */
  11. /* By: Richard Lee Stockton 15 Mar 92  */
  12. /***************************************/
  13. /* Version 1.2 6-21-92                 */
  14. /* Adapted to play from within Chicago */
  15. /* version 1.3 by Matt English 6-6-92  */
  16. /***************************************/
  17.  
  18. CR='0D'x
  19. OPTIONS RESULTS
  20. CALL TIME('R')
  21. SIGNAL ON BREAK_C
  22. SIGNAL ON BREAK_E
  23.  
  24. if getclip('CHICMON') ~= '' then do
  25.    CHICGAME = 1
  26.    purse = getclip('CHICMON')
  27.    dollarsign = '$'
  28.    playstuff = 'CASH'
  29.    if getclip('CHICCOLOR') = 1 then do
  30.      red   = ''
  31.      black = ''
  32.      white = ''
  33.      rev   = ''
  34.      def   = ''
  35.      whred = ''
  36.      whblk = ''
  37.      ital  = ''
  38.      under = ''
  39.     end
  40.    else do
  41.      red   = ''
  42.      black = ''
  43.      white = ''
  44.      rev   = ''
  45.      def   = ''
  46.      whred = ''
  47.      whblk = ''
  48.      ital  = ''
  49.      under = ''
  50.     end
  51.    call pull
  52.   end
  53.  
  54. ARG name purse flag . secs .
  55. IF secs='' THEN secs=2600
  56. IF DATATYPE(flag,'N') & flag~=0 THEN
  57.   DO
  58.     dollarsign=''
  59.     playstuff='TIME SECONDS'
  60.   END
  61. ELSE
  62.   DO
  63.     dollarsign='$'
  64.     playstuff='CASH'
  65.   END
  66.  
  67. /**********************************************************************/
  68. /*                  ANSI.rexx                                         */
  69. /*                  Simple ANSI color escape function assignments     */
  70. /*--------------------------------------------------------------------*/
  71. /*                  James M. Cates Sept. 24 1990                      */
  72. /**********************************************************************/
  73.  
  74. red   = ""       /****************************************/
  75. black = ""       /* These just make life easier when you */
  76. white = ""       /* want some color output.              */
  77. rev   = ""        /****************************************/
  78. def   = ""
  79. whred = ""
  80. whblk = ""
  81. ital  = ""
  82. under = ""
  83.  
  84.  
  85. say ' 'CR
  86. say ' 'CR
  87. if purse>0 then
  88. say '                     Welcome back to the Casino!'CR
  89. else
  90. say '                       Welcome to the Casino!'CR
  91. say ' 'CR
  92. say rev'***********************************************************************'CR
  93. say '*   __       ___    _   __        __  _    __    _        _  ___ ___  *'CR
  94. say '*  /  \ |\ | |_    /_\ |__| |\/| |_  | \  |__\  /_\ |\ | | \  |   |   *'CR
  95. say '*  \__/ | \| |__  /   \|  \ |  | |__ |_/  |__/ /   \| \| |_/ _|_  |   *'CR
  96. say '*                                                                     *'CR
  97. say '*   Revision:  Version 1.2    6-21-92 By: Matt English                *'CR
  98. say '*   Revision:  Version 1.0       1990 By: James M. Cates III          *'CR
  99. say '*   Original:  Version 0.81      1989 By: M.Soucy and M.Fox           *'CR
  100. say '*                                                                     *'CR
  101. say '***********************************************************************'def||CR
  102. say ' 'CR
  103. say ' 'CR
  104. if purse>0 then call name
  105. say 'Do you need Instructions 'red'('def'Y'red'/'def'N'red')'def' ?'CR
  106. arg
  107. pull ans
  108. do i = 1 to 100
  109. if ans = 'Y' then call inst
  110. else call name
  111. do i = 1 to 100
  112.  
  113. inst:
  114. say ' 'CR
  115. say ital'C''mon now, this is a simple game. You just follow my prompts.'CR
  116. say 'I''ll do all the real work, all you really have to do is place your bet.'CR
  117. say ' 'CR
  118. say 'The symbols for each slot are a bit funny, they are only symb-'CR
  119. say 'bolic, so don''t worry. I did not feel like doing ascii represen-'CR
  120. say 'ations of FRUIT...'def||CR
  121. call play
  122.  
  123. play:
  124. say ' 'CR
  125. say 'Do you want to play 'red'('def'Y'red'/'def'N'red')'def' ?'CR
  126. arg
  127. pull ans
  128. if ans = 'Y' then call name
  129. if ans = 'N' then call death
  130. do i = 1 to 100
  131.  
  132. name:
  133. if purse <10 then purse = 100
  134. bet = 0
  135. Tl = 0
  136. Dl = 0
  137. call Pull
  138.  
  139. Pull:
  140. CALL checkBBS()
  141. say ' 'CR
  142. if purse = 0 then call rating
  143. if chicgame = 1 then do
  144.  options prompt'  'red'How much cash would you like to bet? > $'def''
  145.  pull bet
  146.  end
  147. else do
  148.  options prompt "Purse =" dollarsign||red||purse||def"  Your bet please "red":"def""
  149.  pull Bet
  150.  end
  151. if bet > 500 then do
  152.  say ''cr
  153.  say' Sorry Bud, there''s a $500 dollar limit at this machine!'cr
  154.  call pull
  155.  end
  156. if Bet > purse then
  157.  do
  158. say ' 'CR
  159. say "Sorry "red||name||def" you can't bet over" dollarsign||red||purse||def||CR
  160. do i = 1 to 100
  161.  end
  162. call Pull
  163.  end
  164. else
  165.  if Bet = 0 | Bet < 0 then call whatthehell
  166. else
  167.  if Bet = '' | Bet = ' ' then call Pull
  168. else
  169. say ''cr
  170. say ital'Bet taken...'def||CR
  171. call slots
  172.  
  173. slots:
  174. say ital'Pulling lever for 'under'BIG' playstuff'!'def||CR
  175. call roll
  176. call roll
  177.  
  178. roll:
  179. odz=10
  180. x=OPEN(f,'RAM:DUMMY','W')
  181. CALL WRITELN(f,'DUMMY')
  182. CALL CLOSE(f)
  183. micros=STRIP(WORD(STATEF('RAM:DUMMY'),7))
  184. IF micros<100 THEN micros=micros+100
  185. micros=RIGHT(micros,3)
  186. slot1=(LEFT(micros,1)*(odz/10))%1
  187. slot2=(SUBSTR(micros,2,1)*(odz/10))%1
  188. slot3=(RIGHT(micros,1)*(odz/10))%1
  189. call stakes
  190.  
  191. stakes:
  192. if slot1 = 0 then slot1 = '/'
  193. if slot1 = 1 then slot1 = '@'
  194. if slot1 = 2 then slot1 = '?'
  195. if slot1 = 3 then slot1 = '&'
  196. if slot1 = 4 then slot1 = '^'
  197. if slot1 = 5 then slot1 = '_'
  198. if slot1 = 6 then slot1 = '+'
  199. if slot1 = 7 then slot1 = '%'
  200. if slot1 = 8 then slot1 = '*'
  201. if slot1 = 9 then slot1 = '!'
  202. if slot2 = 0 then slot2 = '/'
  203. if slot2 = 1 then slot2 = '@'
  204. if slot2 = 2 then slot2 = '?'
  205. if slot2 = 3 then slot2 = '&'
  206. if slot2 = 4 then slot2 = '^'
  207. if slot2 = 5 then slot2 = '_'
  208. if slot2 = 6 then slot2 = '+'
  209. if slot2 = 7 then slot2 = '%'
  210. if slot2 = 8 then slot2 = '*'
  211. if slot2 = 9 then slot2 = '!'
  212. if slot3 = 0 then slot3 = '/'
  213. if slot3 = 1 then slot3 = '@'
  214. if slot3 = 2 then slot3 = '?'
  215. if slot3 = 3 then slot3 = '&'
  216. if slot3 = 4 then slot3 = '^'
  217. if slot3 = 5 then slot3 = '_'
  218. if slot3 = 6 then slot3 = '+'
  219. if slot3 = 7 then slot3 = '%'
  220. if slot3 = 8 then slot3 = '*'
  221. if slot3 = 9 then slot3 = '!'
  222. call output
  223.  
  224. output:
  225. say ' 'CR
  226. say '      <'red slot1 def'>      <'red slot2 def'>      <'red slot3 def'>'CR
  227. call compare
  228.  
  229. compare:
  230. if slot1 = slot2 & slot1 ~= slot3 then call winner1
  231.  else
  232. if slot2 = slot3 & slot2 ~= slot1 then call winner1
  233.  else
  234. if slot1 = slot2 & slot1 = slot3 then call winner2
  235.  else purse = (purse - bet)
  236. if chicgame = 1 then do
  237.  say''cr
  238.  say '   Sorry, you just lost $'bet''cr
  239.  call chicexit
  240.  end
  241. call Pull
  242.  
  243. winner1:
  244. say whred'You won double your bet!'def||CR
  245. purse = purse + (bet * 2)
  246. if chicgame = 1 then do
  247.  say''cr
  248.  win = (bet * 2)
  249.  say'    You just won $'win' !'cr
  250.  call chicexit
  251.  end
  252. call Pull
  253.  
  254. winner2:
  255. say whred'You won TRIPLE your bet!'def||CR
  256. purse = purse + (bet * 3)
  257. if chicgame = 1 then do
  258.  say''cr
  259.  win = (bet * 3)
  260.  say'    You just won $'win' !'cr
  261.  call chicexit
  262.  end
  263. call Pull
  264.  
  265. whatthehell:
  266. options prompt 'Do you want to continue 'red'('def'Y'red'/'def'N'red')'def' ?'
  267. do i = 1 to 100
  268. pull ans
  269. arg
  270. if ans = 'Y' then call Pull 
  271.              else do
  272.               if chicgame ~=1 then call rating
  273.               if chicgame = 1 then call chicexit
  274.               end
  275.         end
  276.  
  277. chicexit:
  278.  say''cr
  279.  call setclip('CHICMON',purse)
  280.  exit
  281.  
  282. rating:
  283. if purse > 2000 then RATE = 'Mr. Trump! Your jet is waiting.'
  284. if purse > 1500 & purse <= 2000 then RATE = 'What city are you going to buy?'
  285. if purse > 1000 & purse <= 1500 then RATE = 'Your wallet is fat now!'
  286. if purse > 750 & purse <= 1000 then RATE = 'Pretty good.'
  287. if purse > 500 & purse <= 750 then RATE = 'Well, you did okay.'
  288. if purse > 250 & purse <= 500 then RATE = 'Er..stick to monopoly, eh?'
  289. if purse < 250 & purse >= 100 then RATE = 'You need help!'
  290. if purse < 100 then RATE = 'Hope you have enough for a cab home, sucker!'
  291. say ' '
  292. say 'You had 'dollarsign||red||purse||def' before you quit!'CR
  293. say 'Your rating is : 'ital RATE def||CR
  294. do i = 1 to 200
  295. end
  296.  
  297.  
  298. BREAK_C:
  299. BREAK_E:
  300. death:
  301. say ' 'CR
  302. say 'You made' dollarsign||red||purse||def' today!'CR
  303. say 'Goodbye, 'ital||name||def'.'CR
  304. say ' 'CR
  305. CALL SETCLIP('BBS_winnings',purse)
  306. exit
  307. end
  308.  
  309.  
  310. checkBBS:
  311. IF ADDRESS()~='BAUD' THEN RETURN 0
  312. IF TIME('E')>secs THEN SIGNAL death
  313. dcd
  314. IF RC=0 THEN SIGNAL death
  315. temp=secs-TIME('E')
  316. IF temp<120 THEN SAY '*** Only' temp 'seconds left! ***'CR 
  317. RETURN 0
  318.  
  319.  
  320. /* One_Armed_Bandit.rexx */
  321.