Created
February 16, 2017 09:05
-
-
Save johncalvinroberts/47585c6e7d4595347b38e4c159d4c74d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Drug | |
def initialize | |
@substance = [] | |
@bulk_price = 0 | |
@street_price = 0 | |
@power = 0 | |
end | |
attr_reader :power | |
attr_accessor :bulk_price, :substance, :street_price | |
end | |
class Customer | |
def initialize(payment_types, age, family) | |
@family = family | |
@age = age | |
@payment_types = payment_types | |
end | |
def family? | |
@family | |
end | |
attr_accessor :family | |
attr_reader :age, :payment_types | |
end | |
class Dealer | |
def initialize(carried_weight, location, password) | |
@carried_weight = carried_weight | |
@carried_cash = 0 | |
@location = location | |
@password = password | |
end | |
def how_much_cash | |
return "Never telling nobody" | |
end | |
def where_you_at(message) | |
#will be used for verification | |
if message == @password | |
return "I'm at #{@location}" | |
else | |
"get lost! i'm a coding drug dealer" | |
end | |
end | |
def make_a_deal(customer, password) | |
if @location == "Home" | |
return "no deal" | |
elsif customer.family? == true | |
return "no deal" | |
elsif password != @password | |
return "no deal" | |
elsif !customer.payment_types.include?("cash") | |
return "no deal" | |
else | |
return "deal!" | |
end | |
end | |
def change_location | |
locations = %w( Home X-Node FuminLu Yogastudio 新疆 ) | |
@location = locations.sample | |
return nil | |
end | |
end | |
max_the_dealer = Dealer.new(100, "X-Node", "ilovecoding") | |
forrest = Customer.new(["cash", "jiu jitsu lessons"], 17, false ) | |
# p max_the_dealer.change_location | |
# p max_the_dealer.where_you_at("ilovecoding") | |
until max_the_dealer.where_you_at("ilovecoding") == "I'm at Yogastudio" | |
p max_the_dealer.where_you_at("ilovecoding") | |
max_the_dealer.change_location | |
end | |
# p max_the_dealer.make_a_deal(forrest, "crack") | |
# jing = Customer.new(["wechat"], 25, true) | |
# jings_dad = Dealer.new | |
# p jings_dad.make_a_deal(jing, "crack") | |
#if dealer at home, no deal | |
#if customer is family member, no deal | |
#if customer paying in credit, no deal | |
#if you're carrying more than 1kg, no deal | |
# number 1. never let no one know How much dough you hold cause you know | |
# Number 2: never let 'em know your next move Don't you know Bad Boys move in silence and violence? | |
# Number 3: never trust nobody | |
# Number 4: I know you heard this before "Never get high on your own supply” | |
# Number 5: never sell no crack where you rest at | |
# Number 6: that goddamn credit? Dead it .. if you don’t have cash | |
# 7: this rule is so underrated: Keep your family and business completely separated…if family member = deal canceled | |
# Number 8: never keep no weight on you!..if the customer wants > 1kg, no deal | |
# Number 9 shoulda been Number 1 to me: | |
# If you ain't got the clientele, say "hell no!” |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment