probability/rarity.rb
#requests user input regarding the color traits of their release copy
requests user input regarding the color traits of their release copy
requests user input regarding the color traits of their release copy
def user_input_unit
  puts "\nPlease enter the color of the album copy:".green 
  @unit_color = gets.chomp.downcase.gsub(/\s+/, "")
  if @unit_color == "grey"
    then @unit_var = @grey_perc
  elsif @unit_color == "yellow"
    then @unit_var = @yellow_perc
  elsif @unit_color == "blue"
    then @unit_var = @blue_perc
  elsif @unit_color == "red"
    then @unit_var = @red_perc
  elsif @unit_color == "green"
    then @unit_var = @green_perc
  else
    puts "\nSomething went wrong: could not read input, please check for spelling or other errors.".red 
    user_input_unit
  end
unit_rarity
    end
def user_input_unit puts "\nPlease enter the color of the album copy:" . green @unit_color = gets . chomp . downcase . gsub ( / \s + / , "" ) if @unit_color == "grey" then @unit_var = @grey_perc elsif @unit_color == "yellow" then @unit_var = @yellow_perc elsif @unit_color == "blue" then @unit_var = @blue_perc elsif @unit_color == "red" then @unit_var = @red_perc elsif @unit_color == "green" then @unit_var = @green_perc else puts "\nSomething went wrong: could not read input, please check for spelling or other errors." . red user_input_unit end unit_rarity end
requests user input regarding the color traits of their release copy
requests user input regarding the color traits of their release copy
#uses Colorize gem #uses Colorize gem