-
Notifications
You must be signed in to change notification settings - Fork 0
/
hours.rb
88 lines (79 loc) · 3.21 KB
/
hours.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
lakeSt = [[-1, 2, 3, 4, 5, 7, 8, 9, 8, 7, 7, 7, 7, 5, 3, -1, -1], [-1, 2, 3, 4, 5, 5, 5, 6, 7, 8, 8, 8, 8, 7, 5, 2, -1], [-1, 1, 2, 3, 4, 4, 4, 4, 5, 6, 7, 7, 6, 6, 4, 2, -1], [-1, 2, 3, 4, 5, 5, 5, 5, 6, 7, 7, 7, 6, 6, 5, 3, -1], [-1, 1, 2, 3, 4, 5, 6, 6, 6, 7, 8, 8, 8, 7, 5, 3, -1], [-1, 1, 3, 4, 5, 6, 6, 6, 7, 8, 9, 8, 7, 7, 6, 3, -1], [-1, 3, 4, 5, 6, 8, 9, 10, 9, 8, 7, 7, 7, 6, 4, 3, -1]]
brighton = [[-1, 1, 3, 5, 7, 8, 8, 8, 7, 7, 7, 7, 6, 5, 4, 2, -1], [-1, 1, 2, 3, 4, 5, 5, 5, 5, 6, 7, 7, 6, 5, 3, 2, -1], [-1, 1, 1, 2, 3, 4, 4, 4, 4, 4, 4, 5, 4, 4, 3, 2, -1], [-1, 1, 1, 2, 3, 4, 4, 5, 5, 5, 5, 6, 6, 5, 4, 2, -1], [-1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 5, 6, 6, 5, 4, 2, -1], [-1, 1, 2, 3, 4, 5, 5, 5, 5, 5, 6, 6, 6, 5, 4, 2, -1], [-1, 1, 3, 5, 7, 9, 9, 8, 7, 7, 9, 10, 9, 7, 5, 3, 1]]
nicollet = [[-1, -1, -1, 2, 4, 6, 5, 4, 4, 5, 4, 2, 2, 1, -1, -1, -1], [1, 2, 3, 5, 6, 7, 8, 8, 7, 6, 6, 6, 5, 4, 2, -1, -1], [1, 2, 3, 5, 7, 8, 8, 7, 6, 6, 6, 6, 5, 4, 2, -1, -1], [1, 2, 4, 6, 7, 9, 9, 8, 7, 7, 7, 6, 4, 2, 1, -1, -1], [1, 2, 3, 5, 7, 8, 9, 9, 8, 7, 7, 6, 5, 4, 3, -1, -1], [1, 2, 4, 6, 8, 10, 10, 9, 9, 9, 8, 7, 7, 6, 4, -1, -1], [-1, 2, 4, 6, 8, 9, 9, 8, 7, 6, 6, 7, 6, 4, 2, -1, -1]]
fifthSt = [[-1, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 5, 2, -1], [1, 1, 2, 3, 4, 5, 5, 5, 5, 6, 8, 9, 6, 4, 4, 2, -1], [1, 1, 2, 2, 3, 3, 3, 3, 5, 6, 7, 6, 5, 5, 5, 3, -1], [1, 1, 2, 3, 4, 4, 4, 4, 5, 5, 6, 7, 7, 7, 5, 3, -1], [1, 1, 2, 3, 3, 4, 4, 4, 4, 5, 6, 7, 7, 6, 5, 3, -1], [1, 1, 1, 2, 3, 4, 5, 5, 6, 6, 6, 6, 5, 4, 4, 5, -1], [-1, 1, 1, 3, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 5, 3, -1]]
if _ == "7am" [then]
time = 0
elsif _ == "8am" [then]
time = 1
elsif _ == "9am" [then]
time = 2
elsif _ == "10am" [then]
time = 3
elsif _ == "11am" [then]
time = 4
elsif _ == "12pm" [then]
time = 5
elsif _ == "1pm" [then]
time = 6
elsif _ == "2pm" [then]
time = 7
elsif _ == "3pm" [then]
time = 8
elsif _ == "4pm" [then]
time = 9
elsif _ == "5pm" [then]
time = 10
elsif _ == "6pm" [then]
time = 11
elsif _ == "7pm" [then]
time = 12
elsif _ == "8pm" [then]
time = 13
elsif _ == "9pm" [then]
time = 14
elsif _ == "10pm" [then]
time = 15
elsif _ == "11pm" [then]
time = 16
end
if _ == "Sunday" [then]
day = 0
elsif _ == "Monday" [then]
day = 1
elsif _ == "Tuesday" [then]
day = 2
elsif _ == "Wednesday" [then]
day = 3
elsif _ == "Thursday" [then]
day = 4
elsif _ == "Friday" [then]
day = 5
elsif _ == "Saturday" [then]
day = 6
end
lakeStBusy = lakeSt[day][time]
brightonBusy = brighton[day][time]
nicolletBusy = nicollet[day]time]
fifthStBusy = fifthSt[day][time]
timeArray = [lakeStBusy, brightonBusy, nicolletBusy, fifthStBusy]
BESTstore = timeArray.min
lakeSTBEST = 0
brightonBEST = 0
nicolletBEST = 0
fifthStBEST = 0
class store
atrr_accessor :name, :x, :y, :array
end
LS = store.new("Lake St", 44.949411, -93.2370545, lakeSt)
Br = store.new("Brighton", 45.0044664, -93.2315656, brighton)
Ni = store.new("Nicollet", 44.9749685, -93.2742589, nicollet)
FS = store.new("Fifth St", 44.9820453, -93.235701, fifthSt)
#compare how busy the stores are, and set best to the least busy#
best = LS
if Br.array[day][time] < best.array[day][time]
best = Br
if Ni.array[day][time] < best.array[day][time]
best = Ni
if FS.array[day][time] < best.array[day][time]
best = FS