burger_game 1.0.6 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/recipe.json CHANGED
@@ -1,35 +1,35 @@
1
- [
2
- {
3
- "Normal Burger":
4
- [
5
- {"Bun": 1},
6
- {"Tomato Sauce": 1},
7
- {"Lettuce": 1},
8
- {"Grilled Chicken": 1},
9
- {"Cheese": 1},
10
- {"Bun": 1}
11
- ]
12
- },
13
- {
14
- "Healthy Burger":
15
- [
16
- {"Bun": 1},
17
- {"Cheese": 1},
18
- {"Tomato Sauce": 1},
19
- {"Grilled Chicken": 2},
20
- {"Lettuce": 3},
21
- {"Bun": 1}
22
- ]
23
- },
24
- {
25
- "Questionable Burger":
26
- [
27
- {"Bun": 1},
28
- {"Cheese": 3},
29
- {"Tomato Sauce": 4},
30
- {"Grilled Chicken": 4},
31
- {"Lettuce": 2},
32
- {"Bun": 1}
33
- ]
34
- }
1
+ [
2
+ {
3
+ "Normal Burger":
4
+ [
5
+ {"Bun": 1},
6
+ {"Tomato Sauce": 1},
7
+ {"Lettuce": 1},
8
+ {"Grilled Chicken": 1},
9
+ {"Cheese": 1},
10
+ {"Bun": 1}
11
+ ]
12
+ },
13
+ {
14
+ "Healthy Burger":
15
+ [
16
+ {"Bun": 1},
17
+ {"Cheese": 1},
18
+ {"Tomato Sauce": 1},
19
+ {"Grilled Chicken": 2},
20
+ {"Lettuce": 3},
21
+ {"Bun": 1}
22
+ ]
23
+ },
24
+ {
25
+ "Questionable Burger":
26
+ [
27
+ {"Bun": 1},
28
+ {"Cheese": 3},
29
+ {"Tomato Sauce": 4},
30
+ {"Grilled Chicken": 4},
31
+ {"Lettuce": 2},
32
+ {"Bun": 1}
33
+ ]
34
+ }
35
35
  ]
data/lib/recipe.rb CHANGED
@@ -1,74 +1,74 @@
1
- # Import Gems
2
- require 'json'
3
- require 'colorize'
4
-
5
- require_relative './screen_message'
6
-
7
- class Recipe
8
- # ERROR HANDLING for reading files
9
- begin
10
- # Read recipe.JSON file
11
- file = File.read(File.join(File.dirname(__FILE__), './recipe.json'))
12
-
13
- rescue Errno::ENOENT => e
14
- puts "Could not find recipe.json file. Please put recipe.json in the 'data' directory."
15
- puts e.message
16
- exit
17
- rescue => e
18
- puts "Something went wrong."
19
- puts "Error message: " + e.message
20
- exit
21
- end
22
-
23
- # Parse JSON file into array
24
- @@all_recipes = JSON.parse(file)
25
-
26
- # Collect recipe names (array of strings)
27
- # and ingredient lists (array of arrays of hashes)
28
- @@recipe_names = []
29
- @@no_of_recipe = 0
30
- @@ingredient_lists = []
31
- @@all_recipes.each do |recipe|
32
- @@recipe_names << recipe.keys[0]
33
- recipe.each do |name, list|
34
- @@ingredient_lists << list
35
- end
36
- end
37
- @@no_of_recipe = @@recipe_names.length
38
-
39
- def initialize
40
- end
41
-
42
- def self.all_recipes
43
- all_recipes_copy = @@all_recipes.dup
44
- end
45
-
46
- def self.recipe_names
47
- @@recipe_names
48
- end
49
-
50
- def self.no_of_recipe
51
- @@no_of_recipe
52
- end
53
-
54
- def self.ingredient_lists
55
- @@ingredient_lists
56
- end
57
-
58
- def display_recipe(recipe_index)
59
- recipe_box = ScreenMessage.new
60
- spacing = ScreenMessage::SPACING
61
-
62
- # Put all string output lines in a variable
63
- recipe = @@recipe_names[recipe_index].center(spacing, " ").upcase + "\n\n" + "*".colorize(:blue) * spacing + "\n\n"
64
-
65
- @@ingredient_lists[recipe_index].each do |list|
66
- list.each do |item, quantity|
67
- recipe += "#{item}".rjust(spacing * 0.6) + " x #{quantity}".ljust(spacing * 0.4) + "\n"
68
- end
69
- end
70
-
71
- # Format output using frame
72
- recipe_box.recipe_frame(recipe)
73
- end
1
+ # Import Gems
2
+ require 'json'
3
+ require 'colorize'
4
+
5
+ require_relative './screen_message'
6
+
7
+ class Recipe
8
+ # ERROR HANDLING for reading files
9
+ begin
10
+ # Read recipe.JSON file
11
+ file = File.read(File.join(File.dirname(__FILE__), './recipe.json'))
12
+
13
+ rescue Errno::ENOENT => e
14
+ puts "Could not find recipe.json file. Please put recipe.json in the 'data' directory."
15
+ puts e.message
16
+ exit
17
+ rescue => e
18
+ puts "Something went wrong."
19
+ puts "Error message: " + e.message
20
+ exit
21
+ end
22
+
23
+ # Parse JSON file into array
24
+ @@all_recipes = JSON.parse(file)
25
+
26
+ # Collect recipe names (array of strings)
27
+ # and ingredient lists (array of arrays of hashes)
28
+ @@recipe_names = []
29
+ @@no_of_recipe = 0
30
+ @@ingredient_lists = []
31
+ @@all_recipes.each do |recipe|
32
+ @@recipe_names << recipe.keys[0]
33
+ recipe.each do |name, list|
34
+ @@ingredient_lists << list
35
+ end
36
+ end
37
+ @@no_of_recipe = @@recipe_names.length
38
+
39
+ def initialize
40
+ end
41
+
42
+ def self.all_recipes
43
+ all_recipes_copy = @@all_recipes.dup
44
+ end
45
+
46
+ def self.recipe_names
47
+ @@recipe_names
48
+ end
49
+
50
+ def self.no_of_recipe
51
+ @@no_of_recipe
52
+ end
53
+
54
+ def self.ingredient_lists
55
+ @@ingredient_lists
56
+ end
57
+
58
+ def display_recipe(recipe_index)
59
+ recipe_box = ScreenMessage.new
60
+ spacing = ScreenMessage::SPACING
61
+
62
+ # Put all string output lines in a variable
63
+ recipe = @@recipe_names[recipe_index].center(spacing, " ").upcase + "\n\n" + "*".colorize(:blue) * spacing + "\n\n"
64
+
65
+ @@ingredient_lists[recipe_index].each do |list|
66
+ list.each do |item, quantity|
67
+ recipe += "#{item}".rjust(spacing * 0.6) + " x #{quantity}".ljust(spacing * 0.4) + "\n"
68
+ end
69
+ end
70
+
71
+ # Format output using frame
72
+ recipe_box.recipe_frame(recipe)
73
+ end
74
74
  end
@@ -1,67 +1,67 @@
1
- require_relative './customer_request'
2
- require_relative './player_option'
3
- require_relative './game_state'
4
-
5
- class ScoreComparison
6
- # Constant variable for max score and threshold
7
- MAX_SCORE = 6
8
- THRESHOLD = 3
9
-
10
- def initialize(player_recipe, customer_recipe)
11
- @player_recipe = player_recipe
12
- @customer_recipe = customer_recipe
13
- @score = 0
14
- end
15
-
16
- def get_score
17
- # Reverse customer recipe (stacked from bottom up)
18
- r_customer_recipe = @customer_recipe.dup
19
- r_customer_recipe.reverse!
20
-
21
- # Compare recipe, score +1 for every correct ingredient-quantity (in order)
22
- @player_recipe.each_with_index do |line, i|
23
- line == r_customer_recipe[i] ? @score += 1 : @score
24
- end
25
-
26
- @score
27
- end
28
-
29
- def get_mood(score)
30
- # 6 happy
31
- # 3-5 neutral
32
- # <2 || >6 angry
33
- if (score <= MAX_SCORE)
34
- if (score == MAX_SCORE)
35
- "happy"
36
- elsif (score >= THRESHOLD)
37
- "neutral"
38
- else
39
- "angry"
40
- end
41
- else
42
- "angry"
43
- end
44
- end
45
-
46
- def calculate_state(mood)
47
- max_reputation = GameState.max_reputation
48
- reputation = GameState.current_reputation
49
- payment = GameState::PAYMENT
50
-
51
- if mood == "happy"
52
- GameState.update_money(payment)
53
- if reputation < max_reputation
54
- GameState.update_reputation(1)
55
- end
56
- elsif mood == "neutral"
57
- GameState.update_money(payment / 2)
58
- else
59
- GameState.update_reputation(-1)
60
- end
61
-
62
- money = GameState.current_money
63
- reputation = GameState.current_reputation
64
-
65
- return money, reputation
66
- end
1
+ require_relative './customer_request'
2
+ require_relative './player_option'
3
+ require_relative './game_state'
4
+
5
+ class ScoreComparison
6
+ # Constant variable for max score and threshold
7
+ MAX_SCORE = 6
8
+ THRESHOLD = 3
9
+
10
+ def initialize(player_recipe, customer_recipe)
11
+ @player_recipe = player_recipe
12
+ @customer_recipe = customer_recipe
13
+ @score = 0
14
+ end
15
+
16
+ def get_score
17
+ # Reverse customer recipe (stacked from bottom up)
18
+ r_customer_recipe = @customer_recipe.dup
19
+ r_customer_recipe.reverse!
20
+
21
+ # Compare recipe, score +1 for every correct ingredient-quantity (in order)
22
+ @player_recipe.each_with_index do |line, i|
23
+ line == r_customer_recipe[i] ? @score += 1 : @score
24
+ end
25
+
26
+ @score
27
+ end
28
+
29
+ def get_mood(score)
30
+ # 6 happy
31
+ # 3-5 neutral
32
+ # <2 || >6 angry
33
+ if (score <= MAX_SCORE)
34
+ if (score == MAX_SCORE)
35
+ "happy"
36
+ elsif (score >= THRESHOLD)
37
+ "neutral"
38
+ else
39
+ "angry"
40
+ end
41
+ else
42
+ "angry"
43
+ end
44
+ end
45
+
46
+ def calculate_state(mood)
47
+ max_reputation = GameState.max_reputation
48
+ reputation = GameState.current_reputation
49
+ payment = GameState::PAYMENT
50
+
51
+ if mood == "happy"
52
+ GameState.update_money(payment)
53
+ if reputation < max_reputation
54
+ GameState.update_reputation(1)
55
+ end
56
+ elsif mood == "neutral"
57
+ GameState.update_money(payment / 2)
58
+ else
59
+ GameState.update_reputation(-1)
60
+ end
61
+
62
+ money = GameState.current_money
63
+ reputation = GameState.current_reputation
64
+
65
+ return money, reputation
66
+ end
67
67
  end
@@ -1,171 +1,171 @@
1
- # Import Gems
2
- require 'tty-box'
3
- require 'tty-prompt'
4
- require 'artii'
5
-
6
- class ScreenMessage
7
- # Constant variable for display formatting space
8
- SPACING = 30
9
-
10
- def initialize
11
- end
12
-
13
- def display_h_money
14
- msg = "Change TARGET_MONEY.\n\t\t\t\t\tThe lower the value, the easier to WIN.\n\t\t\t\t\tDefault is 50. Enter number 10 to 99.\n\t\t\t\t\tUsage example: -m 10"
15
- end
16
-
17
- def display_h_reputation
18
- msg = "Change MAX_REPUTATION.\n\t\t\t\t\tThe lower the value, the easier to GAME OVER.\n\t\t\t\t\tDefault is 10. Enter number 1 to 10.\n\t\t\t\t\tUsage example: -r 2"
19
- end
20
-
21
- def display_invalid(input = "")
22
- msg = "You have entered an invalid value #{input}\nPlease enter the value in a valid format. Use -h or --help to view Help menu.\n"
23
- end
24
-
25
- # Method for displaying message frame
26
- def msg_frame(title, msg, height = 10)
27
- msg_box = TTY::Box.frame({
28
- enable_color: true, # force to always color output
29
- width: 80,
30
- height: height,
31
- align: :center,
32
- padding: 3,
33
- style: {
34
- border: {
35
- fg: :white
36
- }
37
- },
38
- border: :thick,
39
- title: {
40
- top_left: title
41
- }
42
- }) do
43
- msg
44
- end
45
-
46
- msg_box
47
- end
48
-
49
- # Method for displaying recipe frame
50
- def recipe_frame(recipe)
51
- recipe_box = TTY::Box.frame({
52
- enable_color: true, # force to always color output
53
- width: SPACING + 10,
54
- align: :center,
55
- padding: 3,
56
- style: {
57
- border: {
58
- fg: :white
59
- }
60
- }
61
- }) do
62
- recipe
63
- end
64
-
65
- recipe_box
66
- end
67
-
68
- def display_welcome
69
- # Create instance of Artii
70
- artii = Artii::Base.new
71
- title = " WELCOME "
72
- msg = "Hello there... Welcome to" + "\n\n"
73
- msg += artii.asciify('Burger Game') + "\n\n"
74
- msg += "We are going to build burgers for customers." + "\n"
75
- msg += "Clear your mind, put on your best smile..." + "\n"
76
- msg += "And... we're ready to stack 'em burgers!"
77
- height = 24
78
-
79
- # Format output using frame
80
- msg_frame(title, msg, height)
81
- end
82
-
83
- def display_instructions
84
- title = " HOW TO PLAY "
85
- msg = "Instructions:\n\n1. When shop's Menu is displayed, memorise \"burger names\", \"ingredients\" and \"quantity\" needed, and ingredients \"stack order\"." + "\n\n"
86
- msg += "2. Customer's request will consists of the \"name of the burger\", and custom \"preferences\", such as 'no sauce' or 'extra 1 patty'." + "\n\n"
87
- msg += "3. Select ingredient and quantity needed in order, from \"bottom\" of the stack \"to the top\". Enter \"0\" for requests that ask to leave some ingredients out because we need to keep the correct order of the stack." + "\n\n"
88
- msg += "4. When you build the burger perfectly as per customer request, the happy customer will increase your reputation by 1 point and pay $10 for the burger. Otherwise, if you miss a thing or two, but still acceptable, the pay would be halved but no reputation points given. If you fail to make a decent burger for the customer, the angry customer will not pay and they will take 1 point off your reputation." + "\n\n"
89
- msg += "5. Keep enough customers happy and earn money to meet the target (You Win). Be careful not to make too many customers angry and let your reputation get to 0 (Game Over)."
90
- height = 32
91
-
92
- # Format output using frame
93
- msg_frame(title, msg, height)
94
- end
95
-
96
- def display_prologue
97
- title = " PROLOGUE "
98
- msg = "Ruby Burger is dedicated in fulfilling the ever growing customers' demand of customised and personalised burgers.\n"
99
- msg += "Our job is to build a burger following our shop's Menu recipes, while adjusting into different customers' preferences.\n"
100
- msg += "In the next scene, we will memorise our Menu and recipes." + "\n\n"
101
- msg += "Hint:\n"
102
- msg += "Memorise \"burger names\", \"ingredients\" and \"quantity\" needed, and ingredients \"stack order\".\n"
103
- msg += "Build burger from \"bottom up\". Select ingredients from the bottom of the stack to the top as seen in the recipes.\n"
104
- msg += "Enter \"0\" for requests that ask to leave some ingredients to keep the correct order of the stack."
105
- height = 22
106
-
107
- # Format output using frame
108
- msg_frame(title, msg, height)
109
- end
110
-
111
- def display_win
112
- title = " YOU WIN "
113
- msg = "Ruby Burger has reached its goal!\n\nAll thanks to you and your brilliant burger stacking skill.\nNow is time to celebrate and give yourself a reward..." + "\n\n"
114
- msg += "A burger... and chips!" + "\n\n"
115
-
116
- msg += " |\\ /| /|_/|" + "\n"
117
- msg += " |\\||-|\\||-/|/|" + "\n"
118
- msg += " \\\\|\\|//||///" + "\n"
119
- msg += " _..----.._ |\\/\\||//||||" + "\n"
120
- msg += " .' o '. |||\\\\|/\\\\ ||" + "\n"
121
- msg += " / o o \\ | './\\_/.' |" + "\n"
122
- msg += " |o o o| | |" + "\n"
123
- msg += " /'-.._o __.-'\\ | |" + "\n"
124
- msg += " \\ ````` / | |" + "\n"
125
- msg += " |``--........--'`| '.______.'" + "\n"
126
- msg += "\\ / " + "\n"
127
- msg += "jgs `'----------'` " + "\n\n\n"
128
-
129
- msg += "-- all ASCII artwork copyrighted ©1996-01 --" + "\n"
130
- msg += "Joan G. Stark" + "\n"
131
- msg += "-- All Rights Reserved --" + "\n\n"
132
- msg += "\n~ END ~"
133
-
134
- height = 35
135
-
136
- # Format output using frame
137
- msg_frame(title, msg, height)
138
- end
139
-
140
- def display_game_over
141
- # Create instance of Artii
142
- artii = Artii::Base.new
143
- title = " GAME OVER "
144
- msg = artii.asciify('GAME OVER') + "\n\n"
145
- msg += "Oh no! Everyone is leaving because you didn't stack the right burgers!" + "\n\n"
146
- msg += "Owning a burger shop, especially a Ruby one, is tough.\n"
147
- msg += "You need to practice hard (or just use the handicap ARGV in command line, read the instruction in the installation/usage guide in README.md).\n\nDon't give up! You can always try again next time!" + "\n\n"
148
- msg += "You are lucky this is just a game..."
149
- msg += "\n\n\n~ END ~"
150
- height = 30
151
-
152
- # Format output using frame
153
- msg_frame(title, msg, height)
154
- end
155
-
156
- def go_to_next
157
- # Create instance of TTY Prompt
158
- prompt = TTY::Prompt.new
159
-
160
- input = prompt.select("Do you want to continue?") do |menu|
161
- menu.choice "Next"
162
- menu.choice "Exit"
163
- end
164
-
165
- if input == "Exit"
166
- exit
167
- else
168
- input
169
- end
170
- end
1
+ # Import Gems
2
+ require 'tty-box'
3
+ require 'tty-prompt'
4
+ require 'artii'
5
+
6
+ class ScreenMessage
7
+ # Constant variable for display formatting space
8
+ SPACING = 30
9
+
10
+ def initialize
11
+ end
12
+
13
+ def display_h_money
14
+ msg = "Change TARGET_MONEY.\n\t\t\t\t\tThe lower the value, the easier to WIN.\n\t\t\t\t\tDefault is 50. Enter number 10 to 99.\n\t\t\t\t\tUsage example: -m 10"
15
+ end
16
+
17
+ def display_h_reputation
18
+ msg = "Change MAX_REPUTATION.\n\t\t\t\t\tThe lower the value, the easier to GAME OVER.\n\t\t\t\t\tDefault is 10. Enter number 1 to 10.\n\t\t\t\t\tUsage example: -r 2"
19
+ end
20
+
21
+ def display_invalid(input = "")
22
+ msg = "You have entered an invalid value #{input}\nPlease enter the value in a valid format. Use -h or --help to view Help menu.\n"
23
+ end
24
+
25
+ # Method for displaying message frame
26
+ def msg_frame(title, msg, height = 10)
27
+ msg_box = TTY::Box.frame({
28
+ enable_color: true, # force to always color output
29
+ width: 80,
30
+ height: height,
31
+ align: :center,
32
+ padding: 3,
33
+ style: {
34
+ border: {
35
+ fg: :white
36
+ }
37
+ },
38
+ border: :thick,
39
+ title: {
40
+ top_left: title
41
+ }
42
+ }) do
43
+ msg
44
+ end
45
+
46
+ msg_box
47
+ end
48
+
49
+ # Method for displaying recipe frame
50
+ def recipe_frame(recipe)
51
+ recipe_box = TTY::Box.frame({
52
+ enable_color: true, # force to always color output
53
+ width: SPACING + 10,
54
+ align: :center,
55
+ padding: 3,
56
+ style: {
57
+ border: {
58
+ fg: :white
59
+ }
60
+ }
61
+ }) do
62
+ recipe
63
+ end
64
+
65
+ recipe_box
66
+ end
67
+
68
+ def display_welcome
69
+ # Create instance of Artii
70
+ artii = Artii::Base.new
71
+ title = " WELCOME "
72
+ msg = "Hello there... Welcome to" + "\n\n"
73
+ msg += artii.asciify('Burger Game') + "\n\n"
74
+ msg += "We are going to build burgers for customers." + "\n"
75
+ msg += "Clear your mind, put on your best smile..." + "\n"
76
+ msg += "And... we're ready to stack 'em burgers!"
77
+ height = 24
78
+
79
+ # Format output using frame
80
+ msg_frame(title, msg, height)
81
+ end
82
+
83
+ def display_instructions
84
+ title = " HOW TO PLAY "
85
+ msg = "Instructions:\n\n1. When shop's Menu is displayed, memorise \"burger names\", \"ingredients\" and \"quantity\" needed, and ingredients \"stack order\"." + "\n\n"
86
+ msg += "2. Customer's request will consists of the \"name of the burger\", and custom \"preferences\", such as 'no sauce' or 'extra 1 patty'." + "\n\n"
87
+ msg += "3. Select ingredient and quantity needed in order, from \"bottom\" of the stack \"to the top\". Enter \"0\" for requests that ask to leave some ingredients out because we need to keep the correct order of the stack." + "\n\n"
88
+ msg += "4. When you build the burger perfectly as per customer request, the happy customer will increase your reputation by 1 point and pay $10 for the burger. Otherwise, if you miss a thing or two, but still acceptable, the pay would be halved but no reputation points given. If you fail to make a decent burger for the customer, the angry customer will not pay and they will take 1 point off your reputation." + "\n\n"
89
+ msg += "5. Keep enough customers happy and earn money to meet the target (You Win). Be careful not to make too many customers angry and let your reputation get to 0 (Game Over)."
90
+ height = 32
91
+
92
+ # Format output using frame
93
+ msg_frame(title, msg, height)
94
+ end
95
+
96
+ def display_prologue
97
+ title = " PROLOGUE "
98
+ msg = "Ruby Burger is dedicated in fulfilling the ever growing customers' demand of customised and personalised burgers.\n"
99
+ msg += "Our job is to build a burger following our shop's Menu recipes, while adjusting into different customers' preferences.\n"
100
+ msg += "In the next scene, we will memorise our Menu and recipes." + "\n\n"
101
+ msg += "Hint:\n"
102
+ msg += "Memorise \"burger names\", \"ingredients\" and \"quantity\" needed, and ingredients \"stack order\".\n"
103
+ msg += "Build burger from \"bottom up\". Select ingredients from the bottom of the stack to the top as seen in the recipes.\n"
104
+ msg += "Enter \"0\" for requests that ask to leave some ingredients to keep the correct order of the stack."
105
+ height = 22
106
+
107
+ # Format output using frame
108
+ msg_frame(title, msg, height)
109
+ end
110
+
111
+ def display_win
112
+ title = " YOU WIN "
113
+ msg = "Ruby Burger has reached its goal!\n\nAll thanks to you and your brilliant burger stacking skill.\nNow is time to celebrate and give yourself a reward..." + "\n\n"
114
+ msg += "A burger... and chips!" + "\n\n"
115
+
116
+ msg += " |\\ /| /|_/|" + "\n"
117
+ msg += " |\\||-|\\||-/|/|" + "\n"
118
+ msg += " \\\\|\\|//||///" + "\n"
119
+ msg += " _..----.._ |\\/\\||//||||" + "\n"
120
+ msg += " .' o '. |||\\\\|/\\\\ ||" + "\n"
121
+ msg += " / o o \\ | './\\_/.' |" + "\n"
122
+ msg += " |o o o| | |" + "\n"
123
+ msg += " /'-.._o __.-'\\ | |" + "\n"
124
+ msg += " \\ ````` / | |" + "\n"
125
+ msg += " |``--........--'`| '.______.'" + "\n"
126
+ msg += "\\ / " + "\n"
127
+ msg += "jgs `'----------'` " + "\n\n\n"
128
+
129
+ msg += "-- all ASCII artwork copyrighted ©1996-01 --" + "\n"
130
+ msg += "Joan G. Stark" + "\n"
131
+ msg += "-- All Rights Reserved --" + "\n\n"
132
+ msg += "\n~ END ~"
133
+
134
+ height = 35
135
+
136
+ # Format output using frame
137
+ msg_frame(title, msg, height)
138
+ end
139
+
140
+ def display_game_over
141
+ # Create instance of Artii
142
+ artii = Artii::Base.new
143
+ title = " GAME OVER "
144
+ msg = artii.asciify('GAME OVER') + "\n\n"
145
+ msg += "Oh no! Everyone is leaving because you didn't stack the right burgers!" + "\n\n"
146
+ msg += "Owning a burger shop, especially a Ruby one, is tough.\n"
147
+ msg += "You need to practice hard (or just use the handicap ARGV in command line, read the instruction in the installation/usage guide in README.md).\n\nDon't give up! You can always try again next time!" + "\n\n"
148
+ msg += "You are lucky this is just a game..."
149
+ msg += "\n\n\n~ END ~"
150
+ height = 30
151
+
152
+ # Format output using frame
153
+ msg_frame(title, msg, height)
154
+ end
155
+
156
+ def go_to_next
157
+ # Create instance of TTY Prompt
158
+ prompt = TTY::Prompt.new
159
+
160
+ input = prompt.select("Do you want to continue?") do |menu|
161
+ menu.choice "Next"
162
+ menu.choice "Exit"
163
+ end
164
+
165
+ if input == "Exit"
166
+ exit
167
+ else
168
+ input
169
+ end
170
+ end
171
171
  end