-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.groovy
57 lines (44 loc) · 1.2 KB
/
Main.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
class Main {
static void main(String... args) {
////////////////////////////////////////////////////
def trab = new TrabTheTribble()
use (NeutralCategory) {
println trab.toString()
}
println ''
////////////////////////////////////////////////////
use (NiceCategory) {
println Spock.instance.toString()
}
println '\t' + trab.react(Spock.instance)
println ''
////////////////////////////////////////////////////
use (NastyCategory) {
println Koloth.instance.toString()
}
try {
println Koloth.instance.annoy()
}
catch (KlingonException e1) {
println '\t' + trab.say('nasty creature spazzed out _exceptionally_!')
try {
println trab.react(Koloth.instance)
}
catch (KlingonException e2) {
println '\t' + trab.say('nasty creature spazzed out _exceptionally_ again!')
}
}
println ''
////////////////////////////////////////////////////
use (SchizoidCategory) {
println SamTheSchizo.instance.toString()
}
try {
println '\t' + trab.react(SamTheSchizo.instance)
}
catch (GroovyRuntimeException e) {
println '\tterrible result: ' + e.toString()
}
println ''
} // main
} // Main