-
Notifications
You must be signed in to change notification settings - Fork 1
/
more_arrays.rb
81 lines (75 loc) · 1.93 KB
/
more_arrays.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
states = Array[ [ "Alaska"],
[ "Alabama"],
[ "Arkansas"],
[ "Arizona"],
[ "California"],
[ "Colorado"],
[ "Connecticut"],
[ "Delaware"],
[ "Florida"],
[ "Georgia"],
[ "Hawaii"],
[ "Iowa"],
[ "Idaho"],
[ "Illinois"],
[ "Indiana"],
[ "Kansas"],
[ "Kentucky"],
[ "Louisiana"],
[ "Massachusetts"],
[ "Maryland"],
[ "Maine"],
[ "Michigan"],
[ "Minnesota"],
[ "Missouri"],
[ "Mississippi"],
[ "Montana"],
[ "North Carolina"],
[ "North Dakota"],
[ "Nebraska"],
[ "New Hampshire"],
[ "New Jersey"],
[ "New Mexico"],
[ "Nevada"],
[ "New York"],
[ "Ohio"],
[ "Oklahoma"],
[ "Oregon"],
[ "Pennsylvania"],
[ "Rhode Island"],
[ "South Carolina"],
[ "South Dakota"],
[ "Tennessee"],
[ "Texas"],
[ "Utah"],
[ "Virginia"],
[ "Vermont"],
[ "Washington"],
[ "Wisconsin"],
[ "West Virginia"],
[ "Wyoming"] ]
## puts states[1...15]
#
#puts "Start....."
#
#count = states.length - 1
#
#while count > 0
#
# puts states[count]
# count -= 1
#
#end
#
#puts ".....End"
#
#puts states[16]
#puts states.reverse
count = 0
while count < states.length
puts "#{count + 1}. #{states[count]}"
count += 1
end
states.each_with_index do | state, index | # giving states and index
puts "#{index + 1}. #{state}"
end