-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
44 lines (39 loc) · 911 Bytes
/
test.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
// const icons = require('./lib/icons');
const icons = require('./lib/coloredIcons');
var numbers = [
' _ \n| |\n|_|',
' \n |\n |',
' _ \n _|\n|_ ',
' _ \n _|\n _|',
' \n|_|\n |',
' _ \n|_ \n _|',
' _ \n|_ \n|_|',
' _ \n |\n |',
' _ \n|_|\n|_|',
' _ \n|_|\n _|'
]
const helpers = {
celsius: ' _ \n| \n|_ ',
kelvin: ' \n|/ \n|\\ ',
comma: 'o \n \n , ',
space: ' \n \n '
}
// numbers
// .forEach(function (n) {
// console.log(n)
// })
function render() {
var res = []
var args = Array.prototype.slice.call(arguments);
args.forEach(function (item) {
item.split('\n').forEach(function (part, i) {
if(!res[i])
res[i] = ''
res[i] += part
})
})
console.log(res.join('\n'));
}
Object.keys(icons).forEach(function (icon) {
render(icons[icon], helpers.space, numbers[2], numbers[0], helpers.comma, helpers.celsius)
})