Improvements and fixes to 2013/dlowe
The README.md format was messed up (extraneous and erroneous '```'s) due
to the nightmare (or perhaps daymare :-) ) of the many merging conflicts
of yesterday which required repeatedly resolving conflicts in GitHub.
I also renamed 'slen.sh' to 'sflen.sh' as it shows the sparkle OF the
length of all the files rather than a sparkle length. References to
slen.sh have been changed to sflen.sh instead.
The demo.sh script and the sflen.sh script now run:
make all || exit 1
before proceeding. It does not do make clobber before because this only
clutters the output and is unnecessary if everything is already
compiled.
Oh and just for those who wonder if daymare is or is not really a word:
it is but I redefined it; literally it refers to a frightening hallucinatory
experience whilst awake (though perhaps GitHub was hallucinating :-) that
there were conflicts (well there were but there shouldn't have been)).
This commit is contained in:
1 parent
8d8eb98ef6
commit
e4a024b329
4 files changed
+18
-26
No files matched your search
+7
-17
@@ -24,17 +24,9 @@ make
|
||||
./dlowe 16 32 64 128
|
||||
./dlowe 16 32 64 128 256
|
||||
./dlowe 16 32 64 128 256 512
|
||||
|
||||
echo "sparkline of file sizes: $(wc -c * | awk '{print $1}' | xargs ./dlowe)" # or ./slen.sh
|
||||
|
||||
./dlowe 0
|
||||
|
||||
echo "sparkline of file sizes: $(wc -c * | awk '{print $1}' | xargs ./dlowe)" # or ./slen.sh
|
||||
```
|
||||
|
||||
./dlowe 0
|
||||
|
||||
echo "sparkline of file sizes: $(wc -c * | awk '{print $1}' | xargs ./dlowe)" # or ./slen.sh
|
||||
echo "sparkline of file sizes: $(wc -c * | awk '{print $1}' | xargs ./dlowe)" # or ./sflen.sh
|
||||
```
|
||||
|
||||
Alternatively, for the lazy or those short on time, try:
|
||||
@@ -51,10 +43,9 @@ echo 'IOCCC 2013' > ioccc.txt
|
||||
rm -f ioccc.txt
|
||||
```
|
||||
|
||||
|
||||
?
|
||||
|
||||
To make it simpler to see try showing just the last two lines:
|
||||
To make it simpler to see try showing just the different line like:
|
||||
|
||||
```sh
|
||||
./demo.sh | tail -n 2 > 1.txt
|
||||
@@ -79,8 +70,8 @@ something funny (or will it ? :-) ) and when will it do nothing?
|
||||
|
||||
We liked how this entry used Unicode, specifically UTF-8, in a somewhat obfuscated way.
|
||||
|
||||
Also, why doesn't it crash, and produces a correct output when called with one argument
|
||||
or when all arguments are equal?
|
||||
Also, why doesn't it crash but instead produces a correct output when called
|
||||
with one argument or when all arguments are equal?
|
||||
|
||||
For extra fun, compile and run [fun.c](fun.c):
|
||||
|
||||
@@ -106,7 +97,7 @@ and with clang (3.3), we get
|
||||
-2147483648 0 2147483647
|
||||
```
|
||||
|
||||
and with Apple clang version 15.0.0 (clang-1500.0.40.1) we get:
|
||||
and with Apple clang version 15.0.0 (clang-1500.0.40.1) in 2023, we get:
|
||||
|
||||
```
|
||||
1840985120 -2033041452 35979112
|
||||
@@ -117,7 +108,6 @@ Which one is correct? :)
|
||||
NOTE: `make all` will compile [fun.c](fun.c) but to provide a different compiler
|
||||
you can do something like:
|
||||
|
||||
|
||||
```sh
|
||||
make CC=clang fun
|
||||
```
|
||||
@@ -140,10 +130,10 @@ $ echo "sparkline of file lengths: $(wc -c * | awk '{print $1}' | xargs ./sparkl
|
||||
sparkline of file sizes: ▁▁▁▃▃▂▁▂▁▁▉
|
||||
```
|
||||
|
||||
NOTE: this has been provided in [slen.sh](slen.sh) so you can try:
|
||||
NOTE: this has been provided in [sflen.sh](sflen.sh) so you can try:
|
||||
|
||||
```sh
|
||||
./slen.sh
|
||||
./sflen.sh
|
||||
```
|
||||
|
||||
instead.
|
||||
|
||||
+3
-4
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
make clobber all || exit 1
|
||||
|
||||
make all || exit 1
|
||||
echo "$ ./dlowe 0 1 2 3 4 5 6 7"
|
||||
./dlowe 0 1 2 3 4 5 6 7
|
||||
echo
|
||||
@@ -17,5 +16,5 @@ echo
|
||||
echo "$ ./dlowe 0"
|
||||
./dlowe 0
|
||||
echo
|
||||
echo "$ ./slen.sh"
|
||||
./slen.sh
|
||||
echo "$ ./sflen.sh"
|
||||
./sflen.sh
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
make all || exit 1
|
||||
ln -sf dlowe sparkl
|
||||
echo "sparkline of file lengths: $(wc -c ./* | awk '{print $1}' | xargs ./sparkl)"
|
||||
Reference in new issue
Block a user