/
Animal.java
138 lines (128 loc) · 5.98 KB
/
Animal.java
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
130
131
132
133
134
135
136
137
138
import java.util.Scanner;
class Animal {
private static final Scanner SCANNER = new Scanner(System.in);
final String camel = """
Switching on the camera in the camel habitat...
___.-''''-.
/___ @ |
',,,,. | _.'''''''._
' | / \\
| \\ _.-' \\
| '.-' '-.
| ',
| '',
',,-, ':;
',,| ;,, ,' ;;
! ; !'',,,',',,,,'! ; ;:
: ; ! ! ! ! ; ; :;
; ; ! ! ! ! ; ; ;,
; ; ! ! ! ! ; ;
; ; ! ! ! ! ; ;
;,, !,! !,! ;,;
/_I L_I L_I /_I
Look at that! Our little camel is sunbathing!""";
final String lion = """
Switching on the camera in the lion habitat...
,w.
,YWMMw ,M ,
_.---.._ __..---._.'MMMMMw,wMWmW,
_.-"" ''' YP"WMMMMMMMMMb,
.-' __.' .' MMMMW^WMMMM;
_, .'.-'"; `, /` .--"" :MMM[==MWMW^;
,mM^" ,-'.' / ; ; / , MMMMb_wMW" @\\
,MM:. .'.-' .' ; `\\ ; `, MMMMMMMW `"=./`-,
WMMm__,-'.' / _.\\ F'''-+,, ;_,_.dMMMMMMMM[,_ / `=_}
"^MP__.-' ,-' _.--"" `-, ; \\ ; ;MMMMMMMMMMW^``; __|
/ .' ; ; ) )`{ \\ `"^W^`, \\ :
/ .' / ( .' / Ww._ `. `"
/ Y, `, `-,=,_{ ; MMMP`""-, `-._.-,
(--, ) `,_ / `) \\/"") ^" `-, -;"\\:
The lion is roaring!""";
final String deer = """
Switching on the camera in the deer habitat...
/| |\\
`__\\ //__'
|| ||
\\__`\\ |'__/
`_\\ //_'
_.,:---;,._
\\_: :_/
|@. .@|
| |
,\\.-./ \\
;;`-' `---__________-----.-.
;;; \\_\\
';;; |
; | ;
\\ \\ \\ | /
\\_, \\ / \\ |\\
|';| |,,,,,,,,/ \\ \\ \\_
| | | \\ / |
\\ \\ | | / \\ |
| || | | | | |
| || | | | | |
| || | | | | |
|_||_| |_| |_|
/_//_/ /_/ /_/
Our 'Bambi' looks hungry. Let's go to feed it!""";
final String goose = """
Switching on the camera in the goose habitat...
_
,-"" "".
,' ____ `.
,' ,' `. `._
(`. _..--.._ ,' ,' \\ \\
(`-.\\ .-"" ""' / ( d _b
(`._ `-"" ,._ ( `-( \\
<_ ` ( <`< \\ `-._\\
<`- (__< < :
(__ (_<_< ;
`------------------------------------------
The goose is staring intently at you... Maybe it's time to change the channel?""";
final String bat = """
Switching on the camera in the bat habitat...
_________________ _________________
~-. \\ |\\___/| / .-~
~-. \\ / o o \\ / .-~
> \\ W // <
/ /~---~\\ \\
/_ | | _\\
~-. | | .-~
; \\ / i
/___ /\\ /\\ ___\\
~-. / \\_/ \\ .-~
V V
This bat looks like it's doing fine.""";
final String rabbit = """
Switching on the camera in the rabbit habitat...
,
/| __
/ | ,-~ /
Y :| // /
| jj /( .^
>-"~"-v"
/ Y
jo o |
( ~T~ j
>._-' _./
/ "~" |
Y _, |
/| ;-"~ _ l
/ l/ ,-"~ \\
\\//\\/ .- \\
Y / Y
l I !
]\\ _\\ /"\\
(" ~----( ~ Y. )
It looks like we will soon have more rabbits!""";
final String[] animals = {camel, lion, deer, goose, bat, rabbit};
void playGame() {
System.out.print("Please enter the number of the habitat you would like to view: ");
do {
int index = SCANNER.nextInt();
System.out.println("\n" + animals[index]);
System.out.print("Please enter the number of the habitat you would like to view: ");
} while (SCANNER.hasNextInt());
System.out.println("See you later!");
}
}