-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rb
98 lines (86 loc) · 2.41 KB
/
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
require "pry"
require_relative 'color_roulette'
require_relative 'player'
require_relative 'heads_tails'
require "colorize"
def separator
puts
end
class Wallet
attr_accessor :wallet, :money, :player
def initialize
puts "Enter amount to start"
@money = gets.to_i
@wallet = wallet
@wallet == @money
@player = player
end
def add(bet)
self.money += bet
end
def minus(bet)
self.money -= bet
end
end
class Casino
attr_accessor :player
def initialize(player)
@player = player
separator
puts "
__ __) ) ___ /
(, ) | / /) /) (__/_____) , /
| /| / _ // _ ______ _ _/_ ___ _/_(/ _ / _ _ __ ___ /
|/ |/ _(/_(/_(__(_) // (__(/_ (__(_) (__/ )__(/_ / (_(_/_)__(_/ (_(_) o
/ | (______)
".colorize(:light_yellow)
separator
end
def start_game
puts "Please enter your name: "
new_user = gets.strip
@player = Player.new(new_user)
puts "Welcome new player #{new_user}"
main_menu
end
def main_menu
puts "-- Casino Menu --".colorize(:light_blue)
#puts "1) Enter Your Information"
puts "1) Play Roulette"
puts "2) Play Heads or Tails"
puts "3) View Wallet"
puts "4) Exit Casino"
choice = gets.to_i
case choice
# when 1
# main_menu
when 1
ColorRoulette.new(@player)
when 2
HeadsTails.new(@player)
when 3
@player.view_wallet
main_menu
when
4
puts "Thank You for Playing!"
separator
puts "
.------..------..------..------..------..------..------.
|G.--. ||O.--. ||O.--. ||D.--. ||B.--. ||Y.--. ||E.--. |
| ://: || :(): || :(): || ://: || :(): || ://: || (//) |
| ://: || :(): || :(): || (__) || ()() || (//) || ://: |
| '--'G|| '--'O|| '--'O|| '--'D|| '--'B|| '--'Y|| '--'E|
`------'`------'`------'`------'`------'`------'`------'
".colorize(:red)
exit(0)
else
separator
puts "Invalid Selection"
separator
main_menu
end
end
end
menu = Casino.new(@player)
menu.start_game