-
Notifications
You must be signed in to change notification settings - Fork 0
/
scorpion.js
53 lines (47 loc) · 1.48 KB
/
scorpion.js
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
var renderScorpion = function (speak) {
var scorpion = [
" /| |\\ /| |\\ ",
" /| |\\ /| |\\ ",
" / | | \\ / | | \\ ",
" | | | | | | | | ",
" \\ \\/ / __ __ \\ \\/ / ",
" \\ / / / \\ \\ \\ / ",
" \\ / \\ \\__/ / \\ / ",
" \\ / / \\ \\ / ",
" _ \\ \\__/ O O \\__/ / _",
" \\\\ \\___ ___/ // ",
" \\\\___/ ______ \\___// _ ",
" \\\\ ----( )---- // ",
" \\\\_____( ________ )_____// ",
" ~-----( )-----~ _ ",
" _____( ________ )_____ \\ ",
" /,----( )---- _// ",
" // ( ______ ) / \\ ",
" ~ \\ / \\ / ",
" \\ __ / / / ",
" \\ / / / ",
" \\ \\ / / ",
" \\ ~----~ / ",
" \\________/ "
];
var spacer = "";
var message = [' ', '<', ' '];
for (var c in speak) {
message[0] += '-';
message[1] += speak[c];
message[2] += '-';
spacer += ' ';
}
message[0] += ' ';
message[1] += '>';
message[2] += ' ';
message.map(function (line) { console.log(line) });
scorpion.map(function (line) { console.log(spacer + line) });
}
if (require.main === module) {
if (process.argv.length > 2) {
var m = " " + process.argv.slice(2).join(" ") + " ";
}
renderScorpion(m);
}
module.exports = renderScorpion;