From 6739c0168a2d7e1ca3605b649cf9475cf6335ffe Mon Sep 17 00:00:00 2001
From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com>
Date: Wed, 24 Jan 2024 09:50:39 -0800
Subject: [PATCH 1/4] Typo fix in FAQ
---
faq.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/faq.md b/faq.md
index acad445fa..164bbeb2b 100644
--- a/faq.md
+++ b/faq.md
@@ -29,7 +29,7 @@
- [3.3 - Why do some IOCCC winners fail to compile under macOS?](#faq3_3)
- [3.4 - Why does clang or gcc fail to compile an IOCCC winner?](#faq3_4)
- [3.5 - What is this cb tool that is mentioned in the IOCCC?](#faq3_5)
-- [3.6 - An IOCCC winner missed by my terminal application, how do I fix this?](#faq3_6)
+- [3.6 - An IOCCC winner messed up my terminal application, how do I fix this?](#faq3_6)
- [3.7 - How do I run an IOCCC winner that requires X11?](#faq3_7)
- [3.8 - How do I compile an IOCCC winner that requires SDL1 or SDL2?](#faq3_8)
- [3.9 - How do I compile an IOCCC winner that requires (n)curses?](#faq3_9)
@@ -876,7 +876,7 @@ judging the IOCCC. A Unix man page for `cb`
[still exists](https://www.ibm.com/docs/en/aix/7.3?topic=c-cb-command).
-### FAQ 3.6: An IOCCC winner missed by my terminal application, how do I fix this?
+### FAQ 3.6: An IOCCC winner messed up my terminal application, how do I fix this?
The simplest way to do this is to type `reset`. If echo was disabled you can get
usually away with `stty echo`. Sometimes you can also get away with `stty sane`.
From e6565d9d4f508fe4cfdd7041ccb77e9a3ab477cb Mon Sep 17 00:00:00 2001
From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com>
Date: Wed, 24 Jan 2024 10:04:28 -0800
Subject: [PATCH 2/4] Fix scripts in 2020/ferguson1 for shellcheck
---
2020/ferguson1/play.sh | 8 ++++----
2020/ferguson1/snake-colours.sh | 16 ++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/2020/ferguson1/play.sh b/2020/ferguson1/play.sh
index ac153dc15..6d02b0466 100755
--- a/2020/ferguson1/play.sh
+++ b/2020/ferguson1/play.sh
@@ -51,8 +51,8 @@ DFLT[2]="-DHEAD=COLOR_RED" # Head foreground: red (HEAD)
DFLT[3]="-DHB=COLOR_BLACK" # Head background: black (HB)
DFLT[4]="-DBODY=COLOR_GREEN" # Body foreground: green (BODY)
DFLT[5]="-DBS=COLOR_BLACK" # Body background: black (BS)
-DFLT[6]="-DBG=COLOR_WHITE" # Bug foreground: white (BG)
-DFLT[7]="-DBB=COLOR_BLACK" # Bug background: black (BB)
+DFLT[6]="-DBG=COLOR_WHITE" # Bug foreground: white (BG)
+DFLT[7]="-DBB=COLOR_BLACK" # Bug background: black (BB)
COLOURS[0]="-DWALL=COLOR_"
COLOURS[1]="-DWB=COLOR_"
COLOURS[2]="-DHEAD=COLOR_"
@@ -86,9 +86,9 @@ function configure_colours()
show_colours "${i}"
x="${?}"
if [[ "${x}" != 255 ]]; then
- COLOURS[$j]="${COLOURS[$j]}${COLOUR[$x]}"
+ COLOURS[j]="${COLOURS[$j]}${COLOUR[$x]}"
else
- COLOURS[$j]=${DFLT[$j]}
+ COLOURS[j]=${DFLT[$j]}
fi
j=$j+1
done
diff --git a/2020/ferguson1/snake-colours.sh b/2020/ferguson1/snake-colours.sh
index d7404d9d9..2c5286852 100755
--- a/2020/ferguson1/snake-colours.sh
+++ b/2020/ferguson1/snake-colours.sh
@@ -78,26 +78,26 @@ function configure_colours()
for i in "WALL" "WALL (BACKGROUND)" "HEAD" "HEAD (BACKGROUND)" "BODY" "BODY (BACKGROUND)" "BUG" "BUG (BACKGROUND)"; do
show_colours "${i}"
x="${?}"
- if [ "${x}" != 255 ]; then
- COLOURS[$j]="${COLOURS[$j]}${COLOUR[$x]}"
+ if [[ "${x}" != 255 ]]; then
+ COLOURS[j]="${COLOURS[$j]}${COLOUR[$x]}"
else
- COLOURS[$j]=${DFLT[$j]}
+ COLOURS[j]=${DFLT[$j]}
fi
j=$j+1
done
- echo cc -o prog.alt prog.alt.c -D'f(a,b)'='((a)<(b)?(a):(b))' ${COLOURS[0]} ${COLOURS[1]} \
- ${COLOURS[2]} ${COLOURS[3]} ${COLOURS[4]} ${COLOURS[5]} ${COLOURS[6]} ${COLOURS[7]} -lncurses
+ echo cc -o prog.alt prog.alt.c -D'f(a,b)'='((a)<(b)?(a):(b))' "${COLOURS[0]}" "${COLOURS[1]}" \
+ "${COLOURS[2]}" "${COLOURS[3]}" "${COLOURS[4]}" "${COLOURS[5]}" "${COLOURS[6]}" "${COLOURS[7]}" -lncurses
- cc -o prog.alt prog.alt.c -D'f(a,b)'='((a)<(b)?(a):(b))' ${COLOURS[0]} ${COLOURS[1]} \
- ${COLOURS[2]} ${COLOURS[3]} ${COLOURS[4]} ${COLOURS[5]} ${COLOURS[6]} ${COLOURS[7]} -lncurses || exit 1
+ cc -o prog.alt prog.alt.c -D'f(a,b)'='((a)<(b)?(a):(b))' "${COLOURS[0]}" "${COLOURS[1]}" \
+ "${COLOURS[2]}" "${COLOURS[3]}" "${COLOURS[4]}" "${COLOURS[5]}" "${COLOURS[6]}" "${COLOURS[7]}" -lncurses || exit 1
}
make
./termcaps
T="${?}"
-if [ "${T}" -ne 0 ]; then
+if [[ "${T}" -ne 0 ]]; then
read -rp "Terminal issues detected; do you wish to continue anyway (Y/N) ? " ans
[[ "${ans}" != "y" ]] && [[ "${ans}" != "Y" ]] && exit 1
fi
From 4a330a4839e574ec7394dc69f2cc55dc965f4810 Mon Sep 17 00:00:00 2001
From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com>
Date: Wed, 24 Jan 2024 11:08:42 -0800
Subject: [PATCH 3/4] Typo fix (comment) in 2012/grothe/try.sh
---
2012/grothe/try.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/2012/grothe/try.sh b/2012/grothe/try.sh
index 35d43cfe8..1a7945d7f 100755
--- a/2012/grothe/try.sh
+++ b/2012/grothe/try.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
-# try.sh - demonstrate IOCCC winner 2000/tomx
+# try.sh - demonstrate IOCCC winner 2012/grothe
#
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
From 7ba076ee337f6d667bc0e22cf26fa196948a689c Mon Sep 17 00:00:00 2001
From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com>
Date: Wed, 24 Jan 2024 11:09:37 -0800
Subject: [PATCH 4/4] Typo fix (comment) in 2012/endoh2/try.sh
---
2012/endoh2/try.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/2012/endoh2/try.sh b/2012/endoh2/try.sh
index 8d02917ef..5c0acae4a 100755
--- a/2012/endoh2/try.sh
+++ b/2012/endoh2/try.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
-# try.sh - demonstrate IOCCC winner 2000/tomx
+# try.sh - demonstrate IOCCC winner 2012/endoh2
#
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it