Add 2001/cheong/try.sh + format/typo check

This commit is contained in:
Cody Boone Ferguson committed 2023-11-17 12:02:28 -08:00
1 parent 6707d601b6
commit 3c17eac008
3 files changed
+40 -5

No files matched your search

+3 -5
View File
@@ -15,9 +15,7 @@ make
### Try:
```sh
./cheong 1024
./cheong 12345678901234567890
./cheong 05305265226926441255040573044986873789
./try.sh
```
@@ -40,9 +38,9 @@ For example,
```sh
$ cc -o cheong cheong.c
$ cheong 1234567890
$ ./cheong 1234567890
35136
$ cheong 0200000000000000000000000000
$ ./cheong 0200000000000000000000000000
14142135623730
```
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2001/cheong
#
# 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
echo "$ ./cheong 1024" 1>&2
./cheong 1024
echo "$ ./cheong 0512" 1>&2
./cheong 0512
echo "$ ./cheong 12345678901234567890" 1>&2
./cheong 12345678901234567890
echo "$ ./cheong 05305265226926441255040573044986873789" 1>&2
./cheong 05305265226926441255040573044986873789
echo "$ ./cheong 1234567890" 1>&2
./cheong 1234567890
echo "$ ./cheong 0200000000000000000000000000" 1>&2
./cheong 0200000000000000000000000000