-
Notifications
You must be signed in to change notification settings - Fork 0
/
groovyLanguages.groovy
82 lines (80 loc) · 2.24 KB
/
groovyLanguages.groovy
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
say("Press 1 for English")
language = ask ("Pulse dos para españos", [
choices:"[1 DIGITS]",
voice:"carmen",
timeout:10.0
])
exit = true
playIntro = true
while (exit)
{
if(language.value == '1')
{
if(playIntro)
{
say("Welcome to English to Spanish translations!")
playIntro = false
}
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:30.0
])
if(translation.value == '1')
{
say ("¡hola!", [voice: "carmen"])
}
else if(translation.value == '2')
{
say ("despedida", [voice: "carmen"])
}
else if(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
}
}
else if(language.value == '2')
{
if(playIntro)
{
say ("Bienvenido a Traducciones de español a Inglés!", [voice: "carmen"])
playIntro = false
}
translation = ask ("Para las traducciones: pulse uno para saludar, pulse dos para despedirse, pulse tres para ¿Dónde está el más cercano de Taco Bell?, cero para salir", [
choices: "[1 DIGITS]",
voice: "carmen",
timeout: 30.0
])
if(translation.value == '1')
{
say ("Hello")
}
else if(translation.value == '2')
{
say ("Goodbye")
}
else if(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", [voice: "carmen"])
exit = false
}
}
else
{
say ("I'm sorry but that is not a valid entry")
say ("Press 1 f(or English")
language = ask ("Pulse dos para españos", [
choices: "[1 DIGITS]",
voice: "carmen",
timeout: 10.0
])
}
}