From afe89e5f9fc443383c8067ebe870541b73c679da Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 30 Mar 2021 18:17:26 +0200 Subject: m + Add timer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- large.sh | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'large.sh') diff --git a/large.sh b/large.sh index e1d2a22..3b35d3d 100755 --- a/large.sh +++ b/large.sh @@ -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 -- cgit v1.2.3-70-g09d2