Skip to content

Instantly share code, notes, and snippets.

@RodneyPerez
Created February 1, 2016 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RodneyPerez/7da756f08002616522c2 to your computer and use it in GitHub Desktop.
Save RodneyPerez/7da756f08002616522c2 to your computer and use it in GitHub Desktop.
Wyncode_week1_weekend_project
#####################################################################
#Declares the initial variables that will be used later in the program
puts "Welcome to barista world. Would you like to go to start your shift? Yes or No?"
game_start_answer = gets.chomp.downcase
tip_total = 0
number_of_people_in_line = rand(1...7)
#####################################################################
#####################################################################
#Conditional that decides if user is wearing something cute
#######################################################
#Starts game
if game_start_answer == "yes" # Start of A
puts "Please enter your first name"
barista_name = gets.chomp.capitalize
puts "Hello, #{barista_name}"
puts "You are an elite panther barista. You just had a very long and fun night at Sidebar the day before opening on espresso. Everything is upside when you get to the store"
puts "How do you react? get to work , or get angry"
barista_reaction = gets.chomp.downcase
#Conditional that depends on reaction_to_customer
if barista_reaction == "get to work" #Start of Of C
puts "Are you wearing something cute?"
wearing_something_cute = gets.chomp.downcase
if wearing_something_cute == "yes"
wearing_something_cute = true
else
wearing_something_cute = false
end ####################### End of B
#Conditional that decides if user is wearing something cute Start of B
puts "There are #{number_of_people_in_line} people in line"
while number_of_people_in_line > 0 #STart of loop D
if rand(10) > 5 #start of loop E
puts "You just got a very annoying coffee customer. Will you be nice, mean, or sarcastic?"
reaction_to_customer = gets.chomp.downcase
case reaction_to_customer # start of F loop
when "nice"
if wearing_something_cute # start of G loop
puts "Guy turns out to be a total sleeze and thinks you are flirting with him. This makes you uncomfortable but you get a big tip"
tip = 4.00
tip_total += tip
else
puts "You have a nice conversation with the customer and build a great friendship"
tip = 3.00
tip_total += tip
end # end of G
when 'mean'
if wearing_something_cute # start of H loop
puts "The person is distracted by your outfit and doesn't take much offence to your attitude"
tip = 2.50
tip_total += tip
else
puts "Customer does take offence and ends up leaving a poor yelp review"
tip = 0
tip_total += tip
end # end of H loop
when 'sarcastic'
if wearing_something_cute# start of I loop
puts "customer is foreign and does not understand your sarcasm"
tip = 1.00
tip_total += tip
else
puts "customer is foreign and does not understand your sarcasm or the concept of tipping"
tip = 0
tip_total += tip
# end #end of I loop
end # end of F
else
puts "I do not know what will happen if you do that. you will have to start your shift again"
break
end #end of E
tip_total += tip
puts "You got a $#{tip} tip. Your current total is #{tip_total}"
else
puts "This one turned out to be normal"
tip = rand(0..3)
tip_total += tip
puts "You got a $#{tip} tip. Your current total is $#{tip_total.to_f}"
end #End of D
number_of_people_in_line -= 1
end
##############################################################
#Tells the user how much they made at the end of the shift
if tip_total >= 10
puts "you had a very good day"
elsif tip_total == 0
puts "We might need to pick up an extra shift"
else
puts "Hopefully we get more customers next time"
end
#############################################################
elsif barista_reaction == "get angry"
puts "You get very upset and have a nervous break down. End up losing your job and going to Wyncode to find a new career"
else
puts "I have no idea what happens if you react that way"
end # End of C
elsif game_start_answer == "no" # Else if of A
puts "Please get someone to switch with you."
else # Else of A
puts "That is not a valid response. you will have to start your whole shift again."
end # End of A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment