Skip to content

Commit 46586b1

Browse files
committed
add readme
1 parent 4ca9d82 commit 46586b1

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# TerminalGraphics
2+
3+
[![Build Status](https://travis-ci.org/rafaqz/TerminalGraphics.jl.svg?branch=master)](https://travis-ci.org/rafaqz/TerminalGraphics.jl)
4+
[![Coverage Status](https://coveralls.io/repos/rafaqz/TerminalGraphics.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/rafaqz/TerminalGraphics.jl?branch=master)
5+
[![codecov.io](http://codecov.io/github/rafaqz/TerminalGraphics.jl/coverage.svg?branch=master)](http://codecov.io/github/rafaqz/TerminalGraphics.jl?branch=master)
6+
7+
Convert a matrix of Real into a braile or block Unicode string, real fast.
8+
9+
```
10+
pac = [0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0;
11+
0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0;
12+
0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0;
13+
0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0;
14+
0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0;
15+
0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0;
16+
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0;
17+
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0;
18+
1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0;
19+
1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0;
20+
1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1;
21+
1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0;
22+
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0;
23+
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0;
24+
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0;
25+
0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0;
26+
0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0;
27+
0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0;
28+
0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0;
29+
0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0]
30+
31+
julia> print(blockize(pac))
32+
▄▄██████▄▄
33+
▄██████████████▄
34+
▄███████ ████████
35+
▄██████████████▀▀
36+
███████████▀▀
37+
███████████▄▄ ▀
38+
▀██████████████▄▄
39+
▀█████████████████
40+
▀██████████████▀
41+
▀▀██████▀▀
42+
```
43+
44+
Or braile:
45+
46+
```julia
47+
ghost = [1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0;
48+
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0;
49+
1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0;
50+
0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0;
51+
1.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 1.0;
52+
0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0;
53+
1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0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