-
Notifications
You must be signed in to change notification settings - Fork 0
/
rubyLanguages.rb
61 lines (58 loc) · 1.81 KB
/
rubyLanguages.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
say "Press 1 for English"
language = ask "Pulse dos para españos", {
:choices => "[1 DIGITS]",
:voice => "carmen",
:timeout => 10.0
}
exit = true
playIntro = false
while exit
if language.value == '1'
if playIntro
say "Welcome to English to Spanish translations!"
playIntro = false
end
translation = ask "For translations: press 1 for hello, press two for goodbye, press 3 for Where is the closest Taco Bell?, 0 to exit", {
:choices => "[1 DIGITS]",
:timeout => 60.0
}
if translation.value == '1'
say "¡hola!", {:voice => "carmen"}
elsif translation.value == '2'
say "despedida", {:voice => "carmen"}
elsif translation.value == '3'
say "¿Dónde está el más cercano de Taco Bell?", {:voice => "carmen"}
else
say"Thank you for using English to Spanish translation! Goodbye"
exit = false
end
elsif language == 2
if playIntro
say "Bienvenido a Traducciones de español a Inglés!", {:voice => "carmen"}
playIntro = false
end
translation = ask "Para las traducciones: pulse 1 para saludar, pulse dos para despedirse, pulse 3 para ¿Dónde está el más cercano de Taco Bell?, cero para salir", {
:choices => "[1 DIGITS]",
:voice => "carmen",
:timeout => 60.0
}
if translation.value == '1'
say "Hello"
elsif translation.value == '2'
say "Goodbye"
elsif translation.value == '3'
say "Where is the closest Taco Bell?"
else
say "Gracias por usar el español con traducción en Inglés! Adiós"
exit = false
end
else
say "I'm sorry but that is not a valid entry"
say "Press 1 for English"
language = ask "Pulse dos para españos", {
:choices => "[1 DIGITS]",
:voice => "carmen",
:timeout => 10.0
}
end
end