Add 2020/endoh3/run_clock.alt.sh for alt code

The alt code provided by the author back in 2020 uses Unicode but there
wasn't a script for it (the script run_clock.sh which I made some fixes
in last year was added by the judges but no version for the alt code was
added).

The scripts also have another fix in them: make clock or make clock.alt
first as if not and the program does not exist the script will happily
overwrite the C files and prevent it from being compiled. They use 'make
-B' just to be sure that it's compiled.
This commit is contained in:
Cody Boone Ferguson committed 2024-01-31 10:37:40 -08:00
1 parent d56c2c7371
commit c06ac50888
6 files changed
+38 -2

No files matched your search

+2
View File
@@ -1,6 +1,8 @@
#
# sort with: sort -d -u
clock
clock.alt
clock.alt.c
clock.c
*.dSYM
indent
+10 -2
View File
@@ -113,8 +113,8 @@ OBJ= ${PROG}.o
DATA=
TARGET= ${PROG} clock
#
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
ALT_OBJ= ${PROG}.alt.o clock.alt.o
ALT_TARGET= ${PROG}.alt clock.alt
#################
@@ -146,6 +146,14 @@ alt: data ${ALT_TARGET}
${PROG}.alt: ${PROG}.alt.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
clock.alt: clock.alt.c
clock.alt.c: ${PROG}.alt.c
@${RM} -f $@
${CP} -f $< $@
# data files
#
data: ${DATA}
+8
View File
@@ -41,6 +41,14 @@ make alt
Use `prog.alt` as you would `prog` above.
### Alternate try:
```sh
./run_clock.alt
# And watch closely for 15-20 seconds
```
## Judges' remarks:
You may be tempted to use a mirror. Resist the temptation! Try figuring out how
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
make -B clock.alt || exit 1
while true; do
cc -std=c11 -Wall -Wextra -pedantic -O3 clock.alt.c -o clock.alt
clear
./clock.alt | tee clock.alt.c
sleep 5
done
+1
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
make -B clock || exit 1
while true; do
cc -std=c11 -Wall -Wextra -pedantic -O3 clock.c -o clock
clear