Created
December 8, 2019 10:59
-
-
Save rhowe/acb5a63e3a2361b58ee238804649a218 to your computer and use it in GitHub Desktop.
AOC2019day8part2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
set -o pipefail | |
input=$1 | |
width=$2 | |
height=$3 | |
cd "$(dirname "$0")" | |
rm -rf tmp | |
mkdir tmp | |
cd tmp | |
split -b "$((width * height))" "../$1" | |
sed -i 's/./&\n/g' * | |
paste -d '' *|sed -e 's/^2*\(.\).*/\1/' |xargs -n "$width" |tr -d \ | tr 0 ' ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment