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 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 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 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`.