Add 1985/lycklama/try.alt.sh
This commit is contained in:
1 parent
89c5171c26
commit
ec71d8ad68
3 files changed
+46
-12
No files matched your search
+1
-12
@@ -31,18 +31,7 @@ make SLEEP=700 clobber alt
|
||||
which would set it at 700. Then, whether you use the default value or not, try:
|
||||
|
||||
```sh
|
||||
./lycklama.alt < lycklama.c
|
||||
|
||||
# notice the difference between the above and this one:
|
||||
./lycklama.alt < lycklama.alt.c
|
||||
|
||||
# also try:
|
||||
./lycklama.alt < lycklama.orig.c
|
||||
|
||||
./lycklama.alt < README.md
|
||||
|
||||
./lycklama.alt < Makefile
|
||||
|
||||
./try.alt.sh
|
||||
```
|
||||
|
||||
|
||||
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.alt.sh - demonstrate IOCCC winner 1985/lycklama alt code
|
||||
#
|
||||
|
||||
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
|
||||
# this way allows us to have the user specify a different compiler in an easy
|
||||
# way.
|
||||
if [[ -z "$CC" ]]; then
|
||||
CC="cc"
|
||||
fi
|
||||
|
||||
make CC="$CC" alt >/dev/null || exit 1
|
||||
|
||||
# clear screen after compilation so that only the entry is shown
|
||||
clear
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./lycklama.alt < lycklama.c: "
|
||||
echo 1>&2
|
||||
./lycklama.alt < lycklama.c
|
||||
echo 1>&2
|
||||
|
||||
# notice the difference between the above and this one:
|
||||
echo "Notice the difference with the above and this next one." 1>&2
|
||||
read -r -n 1 -p "Press any key to run: ./lycklama.alt < lycklama.alt.c: "
|
||||
echo 1>&2
|
||||
./lycklama.alt < lycklama.alt.c
|
||||
echo 1>&2
|
||||
|
||||
# also try:
|
||||
read -r -n 1 -p "Press any key to run: ./lycklama.alt < lycklama.orig.c: "
|
||||
echo 1>&2
|
||||
./lycklama.alt < lycklama.orig.c
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./lycklama.alt < README.md: "
|
||||
echo 1>&2
|
||||
./lycklama.alt < README.md
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./lycklama.alt < Makefile: "
|
||||
echo 1>&2
|
||||
./lycklama.alt < Makefile
|
||||
@@ -206,6 +206,8 @@ changed the `#o` lines to `#define`. Also `unistd.h` had to be `#include`d.
|
||||
[Yusuke](#yusuke) provided some useful information that amounts to an alternate version
|
||||
that Cody added. See the README.md for details.
|
||||
|
||||
Cody also provided the [try.alt.sh](/1985/lycklama/try.alt.sh) script.
|
||||
|
||||
|
||||
## <a name="1985_shapiro"></a>[1985/shapiro](/1985/shapiro/shapiro.c) ([README.md](/1985/shapiro/README.md]))
|
||||
|
||||
|
||||
Reference in new issue
Block a user