Update 1994/ldb - remove alt code & update README

The alt code served no purpose at all.

Fixed formatting of README.md file.
This commit is contained in:
Cody Boone Ferguson committed 2023-04-14 05:42:15 -07:00
1 parent 7f5ee8ce42
commit c87f1e36fc
3 files changed
+12 -25

No files matched your search

+2 -2
View File
@@ -111,8 +111,8 @@ OBJ= ${PROG}.o
DATA= DATA=
TARGET= ${PROG} TARGET= ${PROG}
# #
ALT_OBJ= ${PROG}.alt.o ALT_OBJ=
ALT_TARGET= ${PROG}.alt ALT_TARGET=
# FORCE use of -trigraphs # FORCE use of -trigraphs
# #
+10 -22
View File
@@ -15,17 +15,16 @@ make all
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this so it would [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this so it would
compile and work with modern compilers. The problem was that `srand()` returns compile and work with modern compilers. The problem was that `srand()` returns
void but it was used in a `||` expression. Thus the comma operator was needed. void but it was used in a `||` expression. Thus the comma operator was needed.
Cody also changed the entry to use `fgets()` instead of `gets()` to make it Cody also changed the entry to use `fgets()` instead of `gets()` to make it safe
safe for lines greater than 231 in length and to prevent a warning at linking or for lines greater than 231 in length and to prevent a warning at linking or at
at runtime. Note that this now prints a newline after the output but this seems runtime, the latter of which can be interspersed with output of the program.
like a worthy compromise for making it safer (fixing it is more problematic than Note that this now prints a newline after the output but this seems like a
it is worth). In macOS another line of output would be shown anyway namely the worthy compromise for making it safer (fixing it is more problematic than it is
warning that it uses gets(). A subtlety about this fix: if a line is greater worth). In macOS another line of output would be shown anyway namely the warning
than 231 in length if the program chooses that line it might print the first 231 that it uses gets(). A subtlety about this fix: if a line is greater than 231 in
characters or it might print (up to) the next 231 characters and so on. Thank length if the program chooses that line it might print the first 231 characters
you Cody for your assistance! or it might print (up to) the next 231 characters and so on. Thank you Cody for
your assistance!
For the original fixed version [ldb.alt.c](ldb.alt.c) see below.
## To run: ## To run:
@@ -47,17 +46,6 @@ printf "The International Obfuscated C Code Contest\n
by Laurion Burchall" | ./ldb by Laurion Burchall" | ./ldb
``` ```
### Alternate code:
For the original version fixed so that it will compile with modern compiles,
try:
```sh
make alt
```
Use `ldb.alt` as you would `ldb`.
## Judges' remarks: ## Judges' remarks:
Trigraphs are natural obfuscators. Most C-beautifiers become C-uglifiers Trigraphs are natural obfuscators. Most C-beautifiers become C-uglifiers
-1
View File
@@ -1 +0,0 @@
int _,O,__??('}'??);main(){while(O?gets((rand()%O++?':':_)+__)||puts(&__??(_??))&_:(srand(time((O+++_))),0)||O);}