day 12, draw montain
This commit is contained in:
parent
e62a2c70b7
commit
f3177e66a3
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<img>
|
||||
<script>
|
||||
let img = document.querySelector('img');
|
||||
img.src = "data:image/png;base64,"+ window.location.hash.substring(1);
|
||||
</script>
|
Loading…
Reference in New Issue