summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2016-05-10 22:20:48 +0000
committerknolax <1339802534.kk@gmail.com>2016-05-10 22:20:48 +0000
commit4fbd58dcbeda4cf29b59413426337c46907c7e64 (patch)
treeb63fec035b7c1112b06154f8229f5f3a735c3bfa
works now
-rw-r--r--chardata/1235
-rw-r--r--chardata/1245
-rw-r--r--chardata/1255
-rw-r--r--chardata/1265
-rw-r--r--chardata/325
-rw-r--r--chardata/335
-rw-r--r--chardata/345
-rw-r--r--chardata/355
-rw-r--r--chardata/365
-rw-r--r--chardata/375
-rw-r--r--chardata/385
-rw-r--r--chardata/395
-rw-r--r--chardata/405
-rw-r--r--chardata/415
-rw-r--r--chardata/425
-rw-r--r--chardata/435
-rw-r--r--chardata/445
-rw-r--r--chardata/455
-rw-r--r--chardata/465
-rw-r--r--chardata/475
-rw-r--r--chardata/485
-rw-r--r--chardata/495
-rw-r--r--chardata/505
-rw-r--r--chardata/515
-rw-r--r--chardata/525
-rw-r--r--chardata/535
-rw-r--r--chardata/545
-rw-r--r--chardata/555
-rw-r--r--chardata/565
-rw-r--r--chardata/575
-rw-r--r--chardata/585
-rw-r--r--chardata/595
-rw-r--r--chardata/605
-rw-r--r--chardata/615
-rw-r--r--chardata/625
-rw-r--r--chardata/635
-rw-r--r--chardata/645
-rw-r--r--chardata/655
-rw-r--r--chardata/665
-rw-r--r--chardata/675
-rw-r--r--chardata/685
-rw-r--r--chardata/695
-rw-r--r--chardata/705
-rw-r--r--chardata/715
-rw-r--r--chardata/725
-rw-r--r--chardata/735
-rw-r--r--chardata/745
-rw-r--r--chardata/755
-rw-r--r--chardata/765
-rw-r--r--chardata/775
-rw-r--r--chardata/785
-rw-r--r--chardata/795
-rw-r--r--chardata/805
-rw-r--r--chardata/815
-rw-r--r--chardata/825
-rw-r--r--chardata/835
-rw-r--r--chardata/845
-rw-r--r--chardata/855
-rw-r--r--chardata/865
-rw-r--r--chardata/876
-rw-r--r--chardata/885
-rw-r--r--chardata/895
-rw-r--r--chardata/905
-rw-r--r--chardata/915
-rw-r--r--chardata/925
-rw-r--r--chardata/935
-rw-r--r--chardata/945
-rw-r--r--chardata/955
-rw-r--r--chardata/965
-rw-r--r--letters.go176
70 files changed, 522 insertions, 0 deletions
diff --git a/chardata/123 b/chardata/123
new file mode 100644
index 0000000..1a16672
--- /dev/null
+++ b/chardata/123
@@ -0,0 +1,5 @@
+01111
+01000
+10000
+01000
+01111
diff --git a/chardata/124 b/chardata/124
new file mode 100644
index 0000000..9ac1903
--- /dev/null
+++ b/chardata/124
@@ -0,0 +1,5 @@
+00100
+00100
+00100
+00100
+00100
diff --git a/chardata/125 b/chardata/125
new file mode 100644
index 0000000..0704468
--- /dev/null
+++ b/chardata/125
@@ -0,0 +1,5 @@
+11110
+00010
+00001
+00010
+11110
diff --git a/chardata/126 b/chardata/126
new file mode 100644
index 0000000..2e8d7a2
--- /dev/null
+++ b/chardata/126
@@ -0,0 +1,5 @@
+00000
+01001
+10101
+10010
+00000
diff --git a/chardata/32 b/chardata/32
new file mode 100644
index 0000000..28f6c6d
--- /dev/null
+++ b/chardata/32
@@ -0,0 +1,5 @@
+00000
+00000
+00000
+00000
+00000
diff --git a/chardata/33 b/chardata/33
new file mode 100644
index 0000000..772ac09
--- /dev/null
+++ b/chardata/33
@@ -0,0 +1,5 @@
+00100
+00100
+00100
+00000
+00100
diff --git a/chardata/34 b/chardata/34
new file mode 100644
index 0000000..cb61af7
--- /dev/null
+++ b/chardata/34
@@ -0,0 +1,5 @@
+01010
+01010
+00000
+00000
+00000
diff --git a/chardata/35 b/chardata/35
new file mode 100644
index 0000000..f4153cf
--- /dev/null
+++ b/chardata/35
@@ -0,0 +1,5 @@
+01010
+11111
+01010
+11111
+01010
diff --git a/chardata/36 b/chardata/36
new file mode 100644
index 0000000..d53bdf5
--- /dev/null
+++ b/chardata/36
@@ -0,0 +1,5 @@
+01111
+10100
+01110
+00101
+11110
diff --git a/chardata/37 b/chardata/37
new file mode 100644
index 0000000..bed87b7
--- /dev/null
+++ b/chardata/37
@@ -0,0 +1,5 @@
+00001
+10010
+00100
+01001
+10000
diff --git a/chardata/38 b/chardata/38
new file mode 100644
index 0000000..a6fad21
--- /dev/null
+++ b/chardata/38
@@ -0,0 +1,5 @@
+00100
+01010
+00100
+01010
+00111
diff --git a/chardata/39 b/chardata/39
new file mode 100644
index 0000000..cfb6b84
--- /dev/null
+++ b/chardata/39
@@ -0,0 +1,5 @@
+00100
+00100
+00000
+00000
+00000
diff --git a/chardata/40 b/chardata/40
new file mode 100644
index 0000000..378e9f2
--- /dev/null
+++ b/chardata/40
@@ -0,0 +1,5 @@
+00111
+01000
+10000
+01000
+00111
diff --git a/chardata/41 b/chardata/41
new file mode 100644
index 0000000..e406b1a
--- /dev/null
+++ b/chardata/41
@@ -0,0 +1,5 @@
+11100
+00010
+00001
+00010
+11100
diff --git a/chardata/42 b/chardata/42
new file mode 100644
index 0000000..40bbb13
--- /dev/null
+++ b/chardata/42
@@ -0,0 +1,5 @@
+10101
+01110
+11111
+01110
+10101
diff --git a/chardata/43 b/chardata/43
new file mode 100644
index 0000000..995006b
--- /dev/null
+++ b/chardata/43
@@ -0,0 +1,5 @@
+00100
+00100
+11111
+00100
+00100
diff --git a/chardata/44 b/chardata/44
new file mode 100644
index 0000000..6a400c6
--- /dev/null
+++ b/chardata/44
@@ -0,0 +1,5 @@
+00000
+00000
+00000
+00100
+00100
diff --git a/chardata/45 b/chardata/45
new file mode 100644
index 0000000..87369e5
--- /dev/null
+++ b/chardata/45
@@ -0,0 +1,5 @@
+00000
+00000
+01110
+00000
+00000
diff --git a/chardata/46 b/chardata/46
new file mode 100644
index 0000000..f54d827
--- /dev/null
+++ b/chardata/46
@@ -0,0 +1,5 @@
+00000
+00000
+00000
+00000
+00100
diff --git a/chardata/47 b/chardata/47
new file mode 100644
index 0000000..57d2496
--- /dev/null
+++ b/chardata/47
@@ -0,0 +1,5 @@
+00001
+00010
+00100
+01000
+10000
diff --git a/chardata/48 b/chardata/48
new file mode 100644
index 0000000..7ab89a6
--- /dev/null
+++ b/chardata/48
@@ -0,0 +1,5 @@
+01110
+10011
+10101
+11001
+01110
diff --git a/chardata/49 b/chardata/49
new file mode 100644
index 0000000..509d033
--- /dev/null
+++ b/chardata/49
@@ -0,0 +1,5 @@
+01100
+00100
+00100
+00100
+11111
diff --git a/chardata/50 b/chardata/50
new file mode 100644
index 0000000..31869b0
--- /dev/null
+++ b/chardata/50
@@ -0,0 +1,5 @@
+11110
+00001
+01110
+10000
+11111
diff --git a/chardata/51 b/chardata/51
new file mode 100644
index 0000000..8370fc7
--- /dev/null
+++ b/chardata/51
@@ -0,0 +1,5 @@
+11110
+00001
+11110
+00001
+11110
diff --git a/chardata/52 b/chardata/52
new file mode 100644
index 0000000..378899d
--- /dev/null
+++ b/chardata/52
@@ -0,0 +1,5 @@
+10001
+10001
+11111
+00001
+00001
diff --git a/chardata/53 b/chardata/53
new file mode 100644
index 0000000..1e5f4a9
--- /dev/null
+++ b/chardata/53
@@ -0,0 +1,5 @@
+11111
+10000
+11110
+00001
+11110
diff --git a/chardata/54 b/chardata/54
new file mode 100644
index 0000000..be7e22b
--- /dev/null
+++ b/chardata/54
@@ -0,0 +1,5 @@
+01111
+10000
+11110
+10001
+01110
diff --git a/chardata/55 b/chardata/55
new file mode 100644
index 0000000..8e17450
--- /dev/null
+++ b/chardata/55
@@ -0,0 +1,5 @@
+11111
+00001
+00010
+00100
+01000
diff --git a/chardata/56 b/chardata/56
new file mode 100644
index 0000000..e7e66da
--- /dev/null
+++ b/chardata/56
@@ -0,0 +1,5 @@
+01110
+10001
+01110
+10001
+01110
diff --git a/chardata/57 b/chardata/57
new file mode 100644
index 0000000..120a346
--- /dev/null
+++ b/chardata/57
@@ -0,0 +1,5 @@
+01110
+10001
+01111
+00001
+00001
diff --git a/chardata/58 b/chardata/58
new file mode 100644
index 0000000..c17e859
--- /dev/null
+++ b/chardata/58
@@ -0,0 +1,5 @@
+00000
+00100
+00000
+00100
+00000
diff --git a/chardata/59 b/chardata/59
new file mode 100644
index 0000000..463c49e
--- /dev/null
+++ b/chardata/59
@@ -0,0 +1,5 @@
+00000
+00100
+00000
+00100
+01000
diff --git a/chardata/60 b/chardata/60
new file mode 100644
index 0000000..8221210
--- /dev/null
+++ b/chardata/60
@@ -0,0 +1,5 @@
+00011
+01100
+10000
+01100
+00011
diff --git a/chardata/61 b/chardata/61
new file mode 100644
index 0000000..6f8f4c5
--- /dev/null
+++ b/chardata/61
@@ -0,0 +1,5 @@
+00000
+11111
+00000
+11111
+00000
diff --git a/chardata/62 b/chardata/62
new file mode 100644
index 0000000..60a564c
--- /dev/null
+++ b/chardata/62
@@ -0,0 +1,5 @@
+11000
+00110
+00001
+00110
+11000
diff --git a/chardata/63 b/chardata/63
new file mode 100644
index 0000000..7de8489
--- /dev/null
+++ b/chardata/63
@@ -0,0 +1,5 @@
+01110
+10001
+00010
+00100
+00100
diff --git a/chardata/64 b/chardata/64
new file mode 100644
index 0000000..a2d0b51
--- /dev/null
+++ b/chardata/64
@@ -0,0 +1,5 @@
+01110
+10001
+10111
+10101
+01111
diff --git a/chardata/65 b/chardata/65
new file mode 100644
index 0000000..20840d9
--- /dev/null
+++ b/chardata/65
@@ -0,0 +1,5 @@
+00100
+01010
+11111
+10001
+10001
diff --git a/chardata/66 b/chardata/66
new file mode 100644
index 0000000..f301933
--- /dev/null
+++ b/chardata/66
@@ -0,0 +1,5 @@
+11110
+10001
+11110
+10001
+11110
diff --git a/chardata/67 b/chardata/67
new file mode 100644
index 0000000..f304639
--- /dev/null
+++ b/chardata/67
@@ -0,0 +1,5 @@
+01111
+10000
+10000
+10000
+01111
diff --git a/chardata/68 b/chardata/68
new file mode 100644
index 0000000..cca4299
--- /dev/null
+++ b/chardata/68
@@ -0,0 +1,5 @@
+11110
+10001
+10001
+10001
+11110
diff --git a/chardata/69 b/chardata/69
new file mode 100644
index 0000000..72b56cd
--- /dev/null
+++ b/chardata/69
@@ -0,0 +1,5 @@
+11111
+10000
+11111
+10000
+11111
diff --git a/chardata/70 b/chardata/70
new file mode 100644
index 0000000..3157665
--- /dev/null
+++ b/chardata/70
@@ -0,0 +1,5 @@
+11111
+10000
+11111
+10000
+10000
diff --git a/chardata/71 b/chardata/71
new file mode 100644
index 0000000..9563d10
--- /dev/null
+++ b/chardata/71
@@ -0,0 +1,5 @@
+01111
+10000
+10011
+10001
+01110
diff --git a/chardata/72 b/chardata/72
new file mode 100644
index 0000000..14f1873
--- /dev/null
+++ b/chardata/72
@@ -0,0 +1,5 @@
+10001
+10001
+11111
+10001
+10001
diff --git a/chardata/73 b/chardata/73
new file mode 100644
index 0000000..44bd541
--- /dev/null
+++ b/chardata/73
@@ -0,0 +1,5 @@
+11111
+00100
+00100
+00100
+11111
diff --git a/chardata/74 b/chardata/74
new file mode 100644
index 0000000..dbfc6bc
--- /dev/null
+++ b/chardata/74
@@ -0,0 +1,5 @@
+11111
+00100
+00100
+00100
+11000
diff --git a/chardata/75 b/chardata/75
new file mode 100644
index 0000000..d0837f0
--- /dev/null
+++ b/chardata/75
@@ -0,0 +1,5 @@
+10001
+10010
+11100
+10010
+10001
diff --git a/chardata/76 b/chardata/76
new file mode 100644
index 0000000..c74507c
--- /dev/null
+++ b/chardata/76
@@ -0,0 +1,5 @@
+10000
+10000
+10000
+10000
+11111
diff --git a/chardata/77 b/chardata/77
new file mode 100644
index 0000000..635e02c
--- /dev/null
+++ b/chardata/77
@@ -0,0 +1,5 @@
+10001
+11011
+10101
+10001
+10001
diff --git a/chardata/78 b/chardata/78
new file mode 100644
index 0000000..5c1b0a6
--- /dev/null
+++ b/chardata/78
@@ -0,0 +1,5 @@
+10001
+11001
+10101
+10011
+10001
diff --git a/chardata/79 b/chardata/79
new file mode 100644
index 0000000..218ea77
--- /dev/null
+++ b/chardata/79
@@ -0,0 +1,5 @@
+01110
+10001
+10001
+10001
+01110
diff --git a/chardata/80 b/chardata/80
new file mode 100644
index 0000000..95668b0
--- /dev/null
+++ b/chardata/80
@@ -0,0 +1,5 @@
+11110
+10001
+11110
+10000
+10000
diff --git a/chardata/81 b/chardata/81
new file mode 100644
index 0000000..2757f1f
--- /dev/null
+++ b/chardata/81
@@ -0,0 +1,5 @@
+01110
+10001
+10001
+01110
+00001
diff --git a/chardata/82 b/chardata/82
new file mode 100644
index 0000000..75505e1
--- /dev/null
+++ b/chardata/82
@@ -0,0 +1,5 @@
+11110
+10001
+11110
+10001
+10001
diff --git a/chardata/83 b/chardata/83
new file mode 100644
index 0000000..aac539f
--- /dev/null
+++ b/chardata/83
@@ -0,0 +1,5 @@
+01111
+10000
+01110
+00001
+11110
diff --git a/chardata/84 b/chardata/84
new file mode 100644
index 0000000..0a20fdb
--- /dev/null
+++ b/chardata/84
@@ -0,0 +1,5 @@
+11111
+00100
+00100
+00100
+00100
diff --git a/chardata/85 b/chardata/85
new file mode 100644
index 0000000..3a78b76
--- /dev/null
+++ b/chardata/85
@@ -0,0 +1,5 @@
+10001
+10001
+10001
+10001
+01110
diff --git a/chardata/86 b/chardata/86
new file mode 100644
index 0000000..a581b26
--- /dev/null
+++ b/chardata/86
@@ -0,0 +1,5 @@
+10001
+10001
+01010
+01010
+00100
diff --git a/chardata/87 b/chardata/87
new file mode 100644
index 0000000..7c01f64
--- /dev/null
+++ b/chardata/87
@@ -0,0 +1,6 @@
+10001
+10001
+10101
+11011
+10001
+
diff --git a/chardata/88 b/chardata/88
new file mode 100644
index 0000000..7734ae8
--- /dev/null
+++ b/chardata/88
@@ -0,0 +1,5 @@
+10001
+01010
+00100
+01010
+10001
diff --git a/chardata/89 b/chardata/89
new file mode 100644
index 0000000..58d3c9b
--- /dev/null
+++ b/chardata/89
@@ -0,0 +1,5 @@
+10001
+01010
+00100
+00100
+00100
diff --git a/chardata/90 b/chardata/90
new file mode 100644
index 0000000..b709bc5
--- /dev/null
+++ b/chardata/90
@@ -0,0 +1,5 @@
+11111
+00010
+00100
+01000
+11111
diff --git a/chardata/91 b/chardata/91
new file mode 100644
index 0000000..aea765d
--- /dev/null
+++ b/chardata/91
@@ -0,0 +1,5 @@
+11111
+10000
+10000
+10000
+11111
diff --git a/chardata/92 b/chardata/92
new file mode 100644
index 0000000..57d2496
--- /dev/null
+++ b/chardata/92
@@ -0,0 +1,5 @@
+00001
+00010
+00100
+01000
+10000
diff --git a/chardata/93 b/chardata/93
new file mode 100644
index 0000000..9132446
--- /dev/null
+++ b/chardata/93
@@ -0,0 +1,5 @@
+11111
+00001
+00001
+00001
+11111
diff --git a/chardata/94 b/chardata/94
new file mode 100644
index 0000000..48f855f
--- /dev/null
+++ b/chardata/94
@@ -0,0 +1,5 @@
+00100
+01010
+00000
+00000
+00000
diff --git a/chardata/95 b/chardata/95
new file mode 100644
index 0000000..335137b
--- /dev/null
+++ b/chardata/95
@@ -0,0 +1,5 @@
+00000
+00000
+00000
+00000
+11111
diff --git a/chardata/96 b/chardata/96
new file mode 100644
index 0000000..658871e
--- /dev/null
+++ b/chardata/96
@@ -0,0 +1,5 @@
+00100
+00010
+00000
+00000
+00000
diff --git a/letters.go b/letters.go
new file mode 100644
index 0000000..c62cfa4
--- /dev/null
+++ b/letters.go
@@ -0,0 +1,176 @@
+package main
+import (
+ "fmt"
+ "bufio"
+ "os"
+ "io/ioutil"
+ "errors"
+ "strconv"
+)
+type runedata struct {
+ Field [5][5]bool;
+}
+func errc (err error) {
+ if err != nil {
+ panic(err);
+ }
+}
+var charA runedata;
+func getrunedata (rrune rune)(rrunedata runedata, err error){
+ tmpstring := strconv.Itoa(int(rrune));
+ _, err = os.Stat("/home/knolax/go/src/letters/chardata/" +tmpstring);
+ if os.IsNotExist(err) {
+ tmpstring = strconv.Itoa(int('#'));
+ err = errors.New("runedata not found");
+ } else {
+ err = nil;
+ }
+ var tmpbytes []byte;
+ tmpbytes ,err = ioutil.ReadFile("/home/knolax/go/src/chardata/"+tmpstring);
+ errc(err);
+ tmpstring = string(tmpbytes);
+ var i = 0;
+ var v = 0;
+ var n = 0;
+ for i < len(rrunedata.Field) {
+ v = 0;
+ for v < len(rrunedata.Field[i]) {
+ if n < len(tmpstring) {
+ if tmpstring[n] == '1' {
+ rrunedata.Field[i][v] = true;
+ v++;
+ } else {
+ if tmpstring[n] == '0' {
+ rrunedata.Field[i][v] = false;
+ v++;
+ }
+ }
+ } else {
+ err = errors.New("runedata too short");
+ return rrunedata, err;
+ }
+ n++;
+ }
+ i++;
+ }
+ return rrunedata, err;
+
+}
+func getcolor (fcolor rune , bcolor rune) (rfcolor , rbcolor []rune, err error){
+ rfcolor = []rune{'\033','[','3'};
+ rbcolor = []rune{'\033','[','4'};
+ rfcolor = append(rfcolor,fcolor);
+ rbcolor = append(rbcolor,bcolor);
+ rfcolor = append(rfcolor,'m');
+ rbcolor = append(rbcolor,'m');
+ return rfcolor , rbcolor , nil;
+}
+func charadd (rchar rune ,fcolor rune, bcolor rune) (err error) {
+ var rrunedata runedata;
+ rrunedata , err = getrunedata(rchar);
+ if (err != nil) && (err != errors.New("runedata too short")) {
+ } else {
+ errc(err);
+ }
+ var i = 0;
+ var v = 0;
+ frune , brune , err := getcolor(fcolor,bcolor);
+ errc(err);
+ for i < len(outp) {
+ outp[i] = append(outp[i],frune...);
+ outp[i] = append(outp[i],brune...);
+ v = 0;
+ for v < len(rrunedata.Field[i]) {
+ if rrunedata.Field[i][v] {
+ outp[i] = append(outp[i],'_');
+ outp[i] = append(outp[i],'/');
+ } else {
+ outp[i] = append(outp[i],' ');
+ outp[i] = append(outp[i],' ');
+ }
+ v++;
+ }
+ outp[i] = append(outp[i],' ');
+ outp[i] = append(outp[i],' ');
+ i++;
+ }
+ err = nil;
+ return err;
+}
+var outp [5][]rune;
+var inp []rune;
+func inito () () {
+ var v = len(outp);
+ var i = 0;
+ var n = 0;
+ for i < v {
+ n = 0;
+ for n < (v-i-1) {
+ outp[i] = append(outp[i],' ');
+ n++;
+ }
+ i++;
+ }
+
+}
+func main () () {
+ var err error;
+ var frune rune = '9';
+ var brune rune = '9';
+ inito();
+ inpreader := bufio.NewReader(os.Stdin);
+ fmt.Println("%[0-9] for foreground color, $[0-9] for background color, / to replace using $9%9 returns the terminal to defaults");
+ var trune rune ;
+ trune , _ ,_ = inpreader.ReadRune()
+ for trune != '\n' {
+ inp = append(inp,trune);
+ trune , _ ,_ = inpreader.ReadRune();
+ }
+ var i = 0;
+ for i < len(inp) {
+ if inp[i] != '[' {
+
+ switch inp[i] {
+ case '%':
+ i++;
+ if (inp[i] <= '9') && (inp[i] >= '0') {
+ frune = inp[i];
+ fmt.Println("setting foreground color %c",inp[i]);
+ }
+ break;
+ case '$':
+ i++;
+ if (inp[i] <= '9') && (inp[i] >= '0') {
+ brune = inp[i];
+ fmt.Println("setting background color %c",inp[i]);
+ }
+ break;
+ default :
+ err = charadd(inp[i],frune,brune);
+ errc(err);
+ break;
+ }
+ } else {
+ i++;
+ err = charadd(inp[i],frune,brune);
+ errc(err);
+ }
+ i++;
+ }
+ i = 0;
+ var v = 0;
+ var tmpstring string;
+ for i < len(outp) {
+ v = 0;
+ for v < len(outp[i]) {
+ fmt.Printf("%c",outp[i][v]);
+ v++;
+ }
+ tmpstring = tmpstring + string(outp[i]);
+ tmpstring = tmpstring + "\n";
+ fmt.Printf("\n");
+ i++;
+ }
+ err = ioutil.WriteFile(string(inp),[]byte(tmpstring),0777);
+ errc(err);
+}