BASICButch

Slot Machine in QB64 (BASIC)

Nov 5th, 2019
756
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Date: 10/6/2019 - been sleeping better lately, but i may think about manhattan too much
  2. 'Programmer: me
  3. 'Purpose: Slot Machine
  4.  
  5. 'SETUP
  6. CLS
  7. OPTION BASE 1
  8. RANDOMIZE TIMER
  9. Money% = 100
  10.  
  11. 'RETURN HERE EVERY SPIN
  12. Start:
  13. IF Money% < 10 THEN GOTO Loser
  14. INPUT "Are you feeling lucky? (1 for yes)"; Choice%
  15. CLS
  16. IF Choice% <> 1 THEN GOTO Smart
  17.  
  18. 'BEGIN SPINNING
  19. Money% = Money% - 10
  20.  
  21. FOR spin% = 1 TO 10
  22.     _DELAY 0.5
  23.     A% = (RND * 8) + 1
  24.     B% = (RND * 8) + 1
  25.     C% = (RND * 8) + 1
  26.     CLS
  27.     PRINT "#############"
  28.     PRINT "|"; A%; "|"; B%; "|"; C%; "|"
  29.     PRINT "#############"
  30.     PRINT ""
  31. NEXT
  32.  
  33. 'PRIZES
  34. IF A% = B% = C% THEN PRINT "WIN!!!": Money% = Money% + 500
  35. IF A% = B% THEN PRINT "Win!!": Money% = Money% + 50
  36. IF B% = C% THEN PRINT "Win!!": Money% = Money% + 50
  37. IF A% = C% THEN PRINT "Win!": Money% = Money% + 25
  38.  
  39. 'Results
  40. PRINT "You have $"; Money%; " remaining."
  41. GOTO Start
  42.  
  43.  
  44. Loser:
  45. PRINT "Completely broke, you're cursed to spend the rest of your days wandering Las Vegas as a homeless harmonica-player!"
  46. END
  47.  
  48. Smart:
  49. CLS
  50. PRINT "You walk away with a cool $"; Money%; " in your wallet!"
  51. IF Money% < 15 THEN PRINT "You're just glad you knew when to walk away,"
  52. IF Money% > 15 THEN PRINT "It's enough for a large pizza," '~$15 for a large pizza in las vegas
  53. IF Money% > 45 THEN PRINT "WITH EVERYTHING ON IT!!! The taste is incredible," '~$30 for BBQ Chicken pizza at ceasars apparently
  54. IF Money% > 145 THEN PRINT "You have enough to pay for an extra night at the bargain hotel," '+$100
  55. PRINT "and you leave Las Vegas with happy memories."
  56. END
RAW Paste Data