Add 2013/cable1/try.sh + format/typo checks
Rather than link to twitter.com there is a new image of the tweet (screenshot). The try.sh has a joke Easter egg in it based on said tweet. Format/typo check README.md file.
This commit is contained in:
1 parent
a441c47ec0
commit
39cb779c19
4 files changed
+66
-6
No files matched your search
@@ -15,11 +15,7 @@ make
|
||||
### Try:
|
||||
|
||||
```sh
|
||||
./cable1 obama republican democrat
|
||||
./cable1 nixon republican democrat
|
||||
./cable1 bush republican democrat
|
||||
./cable1 kennedy republican democrat
|
||||
./cable1 lincoln republican democrat
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -69,7 +65,7 @@ A PC guy as expected. What about that other Steve?
|
||||
Humm .. maybe there is a hidden reason he is leaving the late Micro$oft? :-)
|
||||
Why late? Because:
|
||||
|
||||

|
||||

|
||||
|
||||
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
An important 2023 update about twitter:
|
||||
@@ -102,6 +98,7 @@ case, and prints out their political affiliation.
|
||||
Use `republican` as the 2nd command-line argument, and `democrat` as the 3rd (or
|
||||
equivalent strings of your choice).
|
||||
|
||||
|
||||
### Why is this entry obfuscated/interesting?
|
||||
|
||||
The program looks up the name supplied on the command line against a list of
|
||||
@@ -117,6 +114,7 @@ table?
|
||||
|
||||
- This program needs a little endian CPU to work properly.
|
||||
|
||||
|
||||
### Compiler warnings
|
||||
|
||||
`clang` warns about a missing type specifier for `main()`, and that implicit
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 75 KiB |
Executable
+56
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate IOCCC winner 2013/cable1
|
||||
#
|
||||
|
||||
# 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" all >/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: ./cable1 obama republican democrat: "
|
||||
echo 1>&2
|
||||
./cable1 obama republican democrat
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./cable1 nixon republican democrat: "
|
||||
echo 1>&2
|
||||
./cable1 nixon republican democrat
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./cable1 bush republican democrat: "
|
||||
echo 1>&2
|
||||
./cable1 bush republican democrat
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./cable1 kennedy republican democrat: "
|
||||
echo 1>&2
|
||||
./cable1 kennedy republican democrat
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./cable1 lincoln republican democrat: "
|
||||
echo 1>&2
|
||||
./cable1 lincoln republican democrat
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./cable1 roosevelt republican democrat: "
|
||||
echo 1>&2
|
||||
./cable1 roosevelt republican democrat
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./cable1 fdr republican democrat: "
|
||||
echo 1>&2
|
||||
./cable1 fdr republican democrat
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key: ./cable1 microsoft alive dead: "
|
||||
echo 1>&2
|
||||
./cable1 microsoft alive dead
|
||||
echo 1>&2
|
||||
@@ -3489,6 +3489,12 @@ Cody also added the [try.sh](2013/birken/try.sh) script for the entry and the
|
||||
[try.alt.sh](2013/birken/try.alt.sh) script for the alt code.
|
||||
|
||||
|
||||
## [2013/cable1](2013/cable1/cable1.c) ([README.md](2013/cable1/README.md]))
|
||||
|
||||
[Cody](#cody) added the [try.sh](2013/cable1/try.sh) script which also has an
|
||||
joke Easter egg in it based on the judges' remarks.
|
||||
|
||||
|
||||
## [2013/cable3](2013/cable3/cable3.c) ([README.md](2013/cable3/README.md]))
|
||||
|
||||
[Cody](#cody) fixed this to compile with modern systems. The problems were that
|
||||
|
||||
Reference in new issue
Block a user