I have a problem that I don't know how to resolve:
I have this code that pretty much asks user for date. The problem that I have is that I can't make the array to take var limit as an element whenever user puts a new date. The array resets itself whenever the method 'new_date' ends.
Here is the code:
def new_date
puts "Date please: "
date1 = $stdin.gets.chomp
d, m, y = date1.split('-').map{|x| x.to_i}
limit = day_of_week(d, m, y)
puts days_of_the_week[limit]
$various_dates = []
$various_dates.push(limit)
end
$various_datesat the 7th last line?