Format fix + add try script to 2006/sykes2
The script runs the 'try' section but makes sure to redirect both stderr and stdout to /dev/null as without it it ruins the show. Format fixed README.md. The author suggested to having a table of operator precedence open when looking at the code so I pointed out operator(7).
This commit is contained in:
1 parent
cc868ba67d
commit
1ebb19e76d
2 files changed
+20
-17
No files matched your search
+11
-17
@@ -1,8 +1,6 @@
|
|||||||
# Best One Liner
|
# Best One Liner
|
||||||
|
|
||||||
Stephen Sykes
|
Stephen Sykes
|
||||||
Itäinen koulupolku
|
|
||||||
Kauniainen
|
|
||||||
Finland
|
Finland
|
||||||
<https://web.archive.org/web/20160316092728/http://www.stephensykes.com/>
|
<https://web.archive.org/web/20160316092728/http://www.stephensykes.com/>
|
||||||
|
|
||||||
@@ -15,26 +13,23 @@ make
|
|||||||
## To run:
|
## To run:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./prog
|
./sykes2
|
||||||
```
|
```
|
||||||
|
|
||||||
## Try:
|
## Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
while :; do
|
./sykes2.sh
|
||||||
clear
|
|
||||||
rm -f sykes2
|
|
||||||
make sykes2
|
|
||||||
./sykes2
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This will repeatedly remake the program and run it then sleep for one second for
|
||||||
|
a nice show of time.
|
||||||
|
|
||||||
## Judges' Comments:
|
## Judges' Comments:
|
||||||
|
|
||||||
As they say, "Lather, rinse, repeat"! :-)
|
As they say, "Lather, rinse, repeat"! :-)
|
||||||
|
|
||||||
If you have the time, figure out how this small 1-line entry works!
|
If you have the time :-), figure out how this small 1-line entry works!
|
||||||
|
|
||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
|
|
||||||
@@ -45,16 +40,15 @@ The clock numerals are rendered as an old fashioned 7 segment display.
|
|||||||
The encodings for which segments light for which number, and for where
|
The encodings for which segments light for which number, and for where
|
||||||
each segment appears on screen are hidden in the two strings.
|
each segment appears on screen are hidden in the two strings.
|
||||||
|
|
||||||
When reading the program, you may want to refer to a table of
|
When reading the program, you may want to refer to a table of operator
|
||||||
operator precedence - careful choices were made to keep the usage of
|
precedence (try `man 7 operator`) - careful choices were made to keep the usage
|
||||||
brackets to a minimum, and to keep the character count as low as
|
of brackets to a minimum, and to keep the character count as low as possible.
|
||||||
possible.
|
|
||||||
|
|
||||||
One interesting bit of obfuscation - the null at the end of the second
|
One interesting bit of obfuscation - the null at the end of the second
|
||||||
string actually forms part of the lookup table.
|
string actually forms part of the lookup table.
|
||||||
|
|
||||||
Intel CC warns about the lack of a declaration for the argument to main.
|
Intel CC warns about the lack of a declaration for the argument to `main()`.
|
||||||
(gcc does not notice this though, even with -Wall.) But anyway it can
|
(`gcc` does not notice this though, even with `-Wall`.) But anyway it can
|
||||||
easily be declared as int at the expense of 4 more characters.
|
easily be declared as int at the expense of 4 more characters.
|
||||||
|
|
||||||
I'm not sure of the effects on a hard disk of rewriting the same file
|
I'm not sure of the effects on a hard disk of rewriting the same file
|
||||||
|
|||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
while :; do
|
||||||
|
clear
|
||||||
|
rm -f sykes2
|
||||||
|
make sykes2 2>/dev/null 1>&2
|
||||||
|
./sykes2
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
Reference in new issue
Block a user