forked from kroitor/asciichart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
43 lines (30 loc) · 1.43 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="UTF-8">
<title>asciichart</title>
<script src="asciichart.js"></script>
<script type="text/javascript">
//-----------------------------------------------------------------------------
var s0 = new Array (120)
for (var i = 0; i < s0.length; i++)
s0[i] = 15 * Math.sin (i * ((Math.PI * 4) / s0.length))
console.log (asciichart.plot (s0) + '\n\n')
//-----------------------------------------------------------------------------
var s1 = new Array (120)
for (var i = 0; i < s1.length; i++)
s1[i] = 15 * Math.cos (i * ((Math.PI * 8) / s1.length))
console.log (asciichart.plot (s1, { height: 6 }) + '\n\n')
//-----------------------------------------------------------------------------
var s2 = new Array (120)
s2[0] = Math.round (Math.random () * 15)
for (i = 1; i < s2.length; i++)
s2[i] = s2[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2))
console.log (asciichart.plot (s2) + '\n\n')
//-----------------------------------------------------------------------------
</script>
</head>
<body>
</body>
</html>