diff --git a/d12/cmd.txt b/d12/cmd.txt index 6545496..18212c6 100644 --- a/d12/cmd.txt +++ b/d12/cmd.txt @@ -1 +1,6 @@ pandoc -o fail.pdf -t pdf fail.md + +awk -f draw.awk < input >| input.pgm +convert input.pgm -scale 1600% input.png + +base64 input.png | tr -d '\n' diff --git a/d12/draw.awk b/d12/draw.awk new file mode 100644 index 0000000..6d56a00 --- /dev/null +++ b/d12/draw.awk @@ -0,0 +1,20 @@ +BEGIN { print "P2" + print "81 41" + print "25" +} +{ + split($0,arr,"") + r = "" + #for (a in arr) { + # print a, arr[a] + #} + #nextfile + for (i=1;i<=81;i++) { + c = arr[i] + if (c == "S") { v = 0 } + else if (c == "E") { v = 25 } + else { v = index("abcdefghijklmnopqrstuvwxyz", c)-1 } + r = r " " v + } + print r +} diff --git a/d12/viewpng.html b/d12/viewpng.html new file mode 100644 index 0000000..b2fb999 --- /dev/null +++ b/d12/viewpng.html @@ -0,0 +1,5 @@ + + \ No newline at end of file