Merge pull request #2044 from xexyl/endoh22012-try
Typo fix (comment) in 2012/endoh2/try.sh
This commit is contained in:
5 files changed
+16
-16
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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
|
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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
|
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ DFLT[2]="-DHEAD=COLOR_RED" # Head foreground: red (HEAD)
|
|||||||
DFLT[3]="-DHB=COLOR_BLACK" # Head background: black (HB)
|
DFLT[3]="-DHB=COLOR_BLACK" # Head background: black (HB)
|
||||||
DFLT[4]="-DBODY=COLOR_GREEN" # Body foreground: green (BODY)
|
DFLT[4]="-DBODY=COLOR_GREEN" # Body foreground: green (BODY)
|
||||||
DFLT[5]="-DBS=COLOR_BLACK" # Body background: black (BS)
|
DFLT[5]="-DBS=COLOR_BLACK" # Body background: black (BS)
|
||||||
DFLT[6]="-DBG=COLOR_WHITE" # Bug foreground: white (BG)
|
DFLT[6]="-DBG=COLOR_WHITE" # Bug foreground: white (BG)
|
||||||
DFLT[7]="-DBB=COLOR_BLACK" # Bug background: black (BB)
|
DFLT[7]="-DBB=COLOR_BLACK" # Bug background: black (BB)
|
||||||
COLOURS[0]="-DWALL=COLOR_"
|
COLOURS[0]="-DWALL=COLOR_"
|
||||||
COLOURS[1]="-DWB=COLOR_"
|
COLOURS[1]="-DWB=COLOR_"
|
||||||
COLOURS[2]="-DHEAD=COLOR_"
|
COLOURS[2]="-DHEAD=COLOR_"
|
||||||
@@ -86,9 +86,9 @@ function configure_colours()
|
|||||||
show_colours "${i}"
|
show_colours "${i}"
|
||||||
x="${?}"
|
x="${?}"
|
||||||
if [[ "${x}" != 255 ]]; then
|
if [[ "${x}" != 255 ]]; then
|
||||||
COLOURS[$j]="${COLOURS[$j]}${COLOUR[$x]}"
|
COLOURS[j]="${COLOURS[$j]}${COLOUR[$x]}"
|
||||||
else
|
else
|
||||||
COLOURS[$j]=${DFLT[$j]}
|
COLOURS[j]=${DFLT[$j]}
|
||||||
fi
|
fi
|
||||||
j=$j+1
|
j=$j+1
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -78,26 +78,26 @@ function configure_colours()
|
|||||||
for i in "WALL" "WALL (BACKGROUND)" "HEAD" "HEAD (BACKGROUND)" "BODY" "BODY (BACKGROUND)" "BUG" "BUG (BACKGROUND)"; do
|
for i in "WALL" "WALL (BACKGROUND)" "HEAD" "HEAD (BACKGROUND)" "BODY" "BODY (BACKGROUND)" "BUG" "BUG (BACKGROUND)"; do
|
||||||
show_colours "${i}"
|
show_colours "${i}"
|
||||||
x="${?}"
|
x="${?}"
|
||||||
if [ "${x}" != 255 ]; then
|
if [[ "${x}" != 255 ]]; then
|
||||||
COLOURS[$j]="${COLOURS[$j]}${COLOUR[$x]}"
|
COLOURS[j]="${COLOURS[$j]}${COLOUR[$x]}"
|
||||||
else
|
else
|
||||||
COLOURS[$j]=${DFLT[$j]}
|
COLOURS[j]=${DFLT[$j]}
|
||||||
fi
|
fi
|
||||||
j=$j+1
|
j=$j+1
|
||||||
done
|
done
|
||||||
|
|
||||||
echo cc -o prog.alt prog.alt.c -D'f(a,b)'='((a)<(b)?(a):(b))' ${COLOURS[0]} ${COLOURS[1]} \
|
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
|
"${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]} \
|
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
|
"${COLOURS[2]}" "${COLOURS[3]}" "${COLOURS[4]}" "${COLOURS[5]}" "${COLOURS[6]}" "${COLOURS[7]}" -lncurses || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
make
|
make
|
||||||
|
|
||||||
./termcaps
|
./termcaps
|
||||||
T="${?}"
|
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
|
read -rp "Terminal issues detected; do you wish to continue anyway (Y/N) ? " ans
|
||||||
[[ "${ans}" != "y" ]] && [[ "${ans}" != "Y" ]] && exit 1
|
[[ "${ans}" != "y" ]] && [[ "${ans}" != "Y" ]] && exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
- [3.3 - Why do some IOCCC winners fail to compile under macOS?](#faq3_3)
|
- [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.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.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.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.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)
|
- [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).
|
[still exists](https://www.ibm.com/docs/en/aix/7.3?topic=c-cb-command).
|
||||||
|
|
||||||
|
|
||||||
### <a name="faq3_6"></a>FAQ 3.6: An IOCCC winner missed by my terminal application, how do I fix this?
|
### <a name="faq3_6"></a>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
|
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`.
|
usually away with `stty echo`. Sometimes you can also get away with `stty sane`.
|
||||||
|
|||||||
Reference in new issue
Block a user