diff options
| author | Mattias Andrée <maandree@kth.se> | 2021-03-30 18:17:26 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2021-03-30 18:17:55 +0200 |
| commit | afe89e5f9fc443383c8067ebe870541b73c679da (patch) | |
| tree | 4a52e9ed502fdd0bace255152f8219d92e089d4b /large.sh | |
| parent | Add dice (diff) | |
| download | pdatools-afe89e5f9fc443383c8067ebe870541b73c679da.tar.gz pdatools-afe89e5f9fc443383c8067ebe870541b73c679da.tar.bz2 pdatools-afe89e5f9fc443383c8067ebe870541b73c679da.tar.xz | |
m + Add timer
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'large.sh')
| -rwxr-xr-x | large.sh | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -121,6 +121,17 @@ large_colon() { ' ' } +large_dot() { + printf '%s\n' \ + ' ' \ + ' ' \ + ' ' \ + ' ' \ + ' ' \ + ' ' \ + ' [] ' +} + large_minus() { printf '%s\n' \ ' ' \ @@ -133,24 +144,28 @@ large_minus() { } printf '#define LARGE_Y %i\n' $(large_0 | wc -l) -printf '#define LARGE_X %i\n' $(large_0 | head -n 1 | tr -d '\n' | wc -c) +printf '#define LARGE_X %i\n' $(large_0 | head -n 1 | tr -d '\n' | wc -c) printf '#define LARGE_XC %i\n' $(large_colon | head -n 1 | tr -d '\n' | wc -c) +printf '#define LARGE_XD %i\n' $(large_dot | head -n 1 | tr -d '\n' | wc -c) printf '#define LARGE_XM %i\n' $(large_minus | head -n 1 | tr -d '\n' | wc -c) printf '#define SMALL_Y %i\n' $(expr \( $(large_0 | wc -l) + 1 \) / 2) -printf '#define SMALL_X %i\n' $(expr \( $(large_0 | head -n 1 | tr -d '\n' | wc -c) + 1 \) / 2) +printf '#define SMALL_X %i\n' $(expr \( $(large_0 | head -n 1 | tr -d '\n' | wc -c) + 1 \) / 2) printf '#define SMALL_XC %i\n' $(expr \( $(large_colon | head -n 1 | tr -d '\n' | wc -c) + 1 \) / 2) +printf '#define SMALL_XD %i\n' $(expr \( $(large_dot | head -n 1 | tr -d '\n' | wc -c) + 1 \) / 2) printf '#define SMALL_XM %i\n' $(expr \( $(large_minus | head -n 1 | tr -d '\n' | wc -c) + 1 \) / 2) -for c in 0 1 2 3 4 5 6 7 8 9 colon minus; do +for c in 0 1 2 3 4 5 6 7 8 9 colon dot minus; do if test $c = colon; then printf '%s\n' '#ifdef INCLUDE_LARGE_COLON' + elif test $c = dot; then + printf '%s\n' '#ifdef INCLUDE_LARGE_DOT' elif test $c = minus; then printf '%s\n' '#ifdef INCLUDE_LARGE_MINUS' fi printf 'static const char *large_%s[] = {\n' $c large_$c | \ - sed -e 's/X/ /g' -e 's/\[/\\033\[7m /g' -e 's/\]/ \\033\[m/g' | \ + sed -e 's/X/ /g' -e 's/\[/\\033\[7m /g' -e 's/\]/ \\033\[27m/g' | \ sed -e 's/^/"/' -e 's/$/",/' | \ sed '$s/,$//' printf '};\n' @@ -209,7 +224,7 @@ for c in 0 1 2 3 4 5 6 7 8 9 colon minus; do printf '\n' done | sed -e 's/^/"/' -e 's/$/",/' | sed '$s/,$//' printf '};\n' - if test $c = colon || test $c = minus; then + if test $c = colon || test $c = dot || test $c = minus; then printf '%s\n' '#endif' fi done |
