forked from badesiru/Raga-Scale-Finder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRAGA.rb
129 lines (84 loc) · 2.71 KB
/
RAGA.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#def raga_selection
# puts "Please type the name of the raga of which you want the scale of"
# raga_selection = gets.chomp
# if raga_selection == 'kanakangi'
# kanakangi
# elsif raga_selection == 'ratnangi'
# ratnangi
# elsif raga_selection == 'ganamurti'
# ganamurti
# elsif raga_selection == 'vanaspati'
# vanaspati
# elsif raga_selection == 'manavati'
#
# else return "Please check your spelling and try again"
# end
#end
#def kanakangi
#x = "S R1 G1 M1 P D1 N1 S"
#returnval = x
# puts "Here is the scale of kanakangi" + returnval.to_s
#end
#def ratnangi
#x = "S R1 G1 M1 P D1 N2 S"
#returnval = x
# puts "Here is the scale of ratnangi" + returnval.to_s
#end
#def ganamurti
#x = "S R1 G1 M1 P D1 N3 S"
#returnval = x
# puts "Here is the scale of ganamurti" + returnval.to_s
#end
#def vanaspati
#x = "S R1 G1 M1 P D2 N2 S"
#returnval = x
# puts "Here is the scale of vanaspati" + returnval.to_s
#end
#def manavati
#x = "S R1 G1 M1 P D2 N3 S'"
#returnval = x
# puts "Here is the scale of manavati" + returnval.to_s
#end
#raga = gets.chomp
#puts raga
#search (raga)
#puts "Please type the name of the raga of which you want the scale of"
#initraga = gets.chomp
#hash defn
#initraga = {"kanakangi"=> "S R1 G1 M1 P D1 N1 S", "ratnangi"=> "S R1 G1 M1 P D1 N2 S", "ganamurti" => "S R1 G1 M1 P D1 N3 S", "vanaspati" =>"S R1 G1 M1 P D2 N2 S", "manavati" => "S R1 G1 M1 P D2 N3 S"}
#puts " This is result "
#puts "#{initraga['kanakangi']}"
puts "enter the name of the raga"
def search (raga_name)
puts "in search method : Raga Name =" + raga_name
# #now look up hash with key as raga raga_name
initraga = {"kanakangi"=> "S R1 G1 M1 P D1 N1 S", "ratnangi"=> "S R1 G1 M1 P D1 N2 S", "ganamurti" => "S R1 G1 M1 P D1 N3 S", "vanaspati" =>"S R1 G1 M1 P D2 N2 S", "manavati" => "S R1 G1 M1 P D2 N3 S"}
puts "#{initraga[raga_name]}"
end
#method invocation : call search with raaga name
raga_name = gets.chomp
search (raga_name)
#def raga_name
# if gets.chomp == 'kanakangi'
# return "S R1 G1 M1 P D1 N1 S"
# end
#if name == 'ratnangi'
#return "S R1 G1 M1 P D1 N2 S"
#end
#if name == ganamurti
# return "S R1 G1 M1 P D1 N3 S"
#end
#if name == vanaspati
#puts "#{raga['kanakangi, ratnangi, ganamurti, vanaspati, manavati']}" ## prints value
#ratnangi = {"ratnangi" => "S R1 G1 M1 P D1 N2 S"}
#puts " This is the result of "
#puts "#{ratnangi['ratnangi']}"
#ganamurti = {"ganamurti" => "S R1 G1 M1 P D1 N3 S"}
#puts " This is the result of "
#puts "#{ganamurti['ganamurti']}"
#vanaspati = {"vanaspati" => "S R1 G1 M1 P D2 N2 S"}
#puts " This is the result of "
#puts "#{vanaspati['vanaspati']}"
#manavati = {"manavati" => "S R1 G1 M1 P D2 N3 S'"}
#puts " This is the result of "
#puts "#{manavati['manavati']}"