Drop 1991/fine back to its original 80 chars

With more clever use of the Makefile the number of characters is back
down to 80 which is what the original was!

This also fixes the warning that was introduced when it was dropped back
down to 85. 'B' is defined as '(int)b' which is used in two places where
a cast is necessary or otherwise will silent a warning.

The README.md file has been checked and this should complete this entry
now.
This commit is contained in:
Cody Boone Ferguson committed 2023-11-06 07:09:01 -08:00
1 parent 40e5bff5c7
commit d22dca5b0a
4 files changed
+13 -6

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@ ARCH=
# Defines that are needed to compile
#
CDEFINE= -D'main(a,b)'='int main(a,b)char**b;'
CDEFINE= -D'main(a,b)'='int main(a,b)char**b;' -DB='(int)b'
# Include files that are needed to compile
#
+2 -2
View File
@@ -33,8 +33,8 @@ This filter, 80 chars plus a newline, fits into a single line on most
terminals (unless your terminal has a line wrap mis-feature :-)).
Note in 2023: fixing this entry to work with modern systems increased the size,
originally to 106 characters but dropped down to 85 with clever use of the
Makefile and removal of a cast that was not strictly necessary.
originally to 106 characters but it was dropped back down to 80 with clever use
of the Makefile.
This entry is likely one of the smallest C implementations of this
filter, excluding programs that resort to command line or include
+1 -1
View File
@@ -1 +1 @@
main(a,b){while((a=getchar())+1)putchar((b=64^a&223)&&b<27?a&96|((int)b+12)%26+1:a);}
main(a,b){while((a=getchar())+1)putchar((b=64^a&223)&&B<27?a&96|(B+12)%26+1:a);}
+9 -2
View File
@@ -1233,12 +1233,19 @@ entry was fixed. It has not been done in all.
## [1991/fine](1991/fine/fine.c) ([README.md](1991/fine/README.md))
Cody made it look much more like the original entry even after the fix that
increased the count in characters from 80 to 106, getting it back down to just 85.
increased the count in characters from 80 to 106, getting it back down to just
85 (and later back down to 80, see below).
This was done by redefining `main` at the compiler line so that it looks like
the original where one didn't have to worry about the type of args of main() and
there were other fewer restrictions and also by removing a cast that was
not strictly necessary (this does create a new warning: `ordered comparison
between pointer and integer ('char **' and 'int')` but it works just fine).
between pointer and integer ('char **' and 'int')` but it works just `fine`).
That was `fine` as well but Cody decided to drop it back down to its original 80
which also resolved the warning described above. This was by more clever use of
the Makefile which now has a `-DB=(int)b` so that `B` can be used in place where
`(int)b` used to be necessary.
Cody also added the [try.sh](1991/fine/try.sh) script which feeds the program
some fun input for fun but mostly different output. He added a great string from