Restore 2001/herrmann2 original code

By some chance it was in .gitignore and was entirely missing so I
restored it from the archive.

I also updated the README.md file about the alt (which is the original
in fact) not compiling with clang (something I fixed in the entry
itself) in addition to it might not working in some systems (like 64-bit
systems).
This commit is contained in:
Cody Boone Ferguson committed 2023-11-01 09:36:27 -07:00
1 parent 4fd9a1dbce
commit 609b449d8f
4 files changed
+39 -10

No files matched your search

-1
View File
@@ -1,4 +1,3 @@
herrmann2
herrmann2.orig.c
herrmann2.orig
prog.orig
+3 -2
View File
@@ -75,8 +75,9 @@ diff herrmann2.alt.c herrmann2.orig.c && echo "output matches with original code
## Alternate code:
If you wish to use the original version that does not work for all platforms,
you can make use of the [herrmann2.alt.c](herrmann2.alt.c) by running:
If you wish to use the original version that does not work for all platforms
(and will not even compile with some versions of clang), you can make use of the
[herrmann2.alt.c](herrmann2.alt.c) by running:
```sh
make alt
+23
View File
@@ -0,0 +1,23 @@
char*d,A[9876];char*d,A[9876];char*d,A[9876];char*d,A[9876];char*d,A[9876];char
e;b;*ad,a,c; te;b;*ad,a,c; te;*ad,a,c; w,te;*ad,a, w,te;*ad,and, w,te;*ad,
r,T; wri; ;*h; r,T; wri; ;*h; r; wri; ;*h;_, r; wri;*h;_, r; wri;*har;_, r; wri
;on; ;l ;i(V) ;on; ;l ;i(V) ;o ;l ;mai(V) ;o ;mai(n,V) ;main (n,V)
{-!har ; {-!har ; {har =A; {h =A;ad =A;read
(0,&e,o||n -- +(0,&e,o||n -- +(0,&o||n ,o-- +(0,&on ,o-4,- +(0,n ,o-=94,- +(0,n
,l=b=8,!( te-*A,l=b=8,!( te-*A,l=b,!( time-*A,l=b, time)|-*A,l= time(0)|-*A,l=
~l),srand (l),~l),srand (l),~l),and ,!(l),~l),a ,!(A,l),~l) ,!(d=A,l),~l)
,b))&&+((A + te,b))&&+((A + te,b))+((A -A+ te,b))+A -A+ (&te,b+A -A+(* (&te,b+A
)=+ +95>e?(*& c)=+ +95>e?(*& c) +95>e?(*& _*c) +95>(*& _*c) +95>(*&r= _*c) +95>
5,r+e-r +_:2-195,r+e-r +_:2-195+e-r +_:2-1<-95+e-r +_-1<-95+e-r ++?_-1<-95+e-r
|(d==d),!n ?*d||(d==d),!n ?*d||(d==d),!n ?*d||(d==d),!n ?*d||(d==d),!n ?*d||(d=
*( (char**)+V+ *( (char)+V+ *( (c),har)+V+ (c),har)+ (V+ (c),r)+ (V+ ( c),
+0,*d-7 ) -r+8)+0,*d-7 -r+8)+0,*d-c:7 -r+80,*d-c:7 -r+7:80,*d-7 -r+7:80,*d++-7
+7+! r: and%9- +7+! rand%9-85 +7+! rand%95 +7+!! rand%95 +7+ rand()%95 +7+ r
-(r+o):(+w,_+ A-(r+o)+w,_+*( A-(r+o)+w,_+ A-(r=e+o)+w,_+ A-(r+o)+wri,_+ A-(r+o)
+(o)+b)),!write+(o)+b,!wri,(te+(o)+b,!write+(o=_)+b,!write+(o)+b,!((write+(o)+b
-b+*h)(1,A+b,!!-b+*h),A+b,((!!-b+*h),A+b,!!-b+((*h),A+b,!!-b+*h),A-++b,!!-b+*h)
, a >T^l,( o-95, a >T,( o-=+95, a >T,( o-95, a)) >T,( o-95, a >T,(w? o-95, a >T
++ &&r:b<<2+a ++ &&b<<2+a+w ++ &&b<<2+w ++ ) &&b<<2+w ++ &&b<<((2+w ++ &&
!main(n*n,V) , !main(n,V) , !main(+-n,V) ,main(+-n,V) ) ,main(n,V) ) ,main),(n,
l)),w= +T-->o +l)),w= +T>o +l)),w=o+ +T>o +l,w=o+ +T>o;{ +l,w=o+T>o;{ +l,w &=o+
!a;}return _+= !a;}return _+= !a;}return _+= !a;}return _+= !a;}return _+= !a;}
+13 -7
View File
@@ -1904,15 +1904,21 @@ SC2248 (style): Prefer double quoting even when variables don't contain special
errors/warnings.
## [2001/herrmann2](2001/herrmann2/herrmann2.c) ([README.md](2001/herrmann2/README.md]))
Cody fixed this to work with both 64-bit and 32-bit compilers by changing most of
the `int`s (all but that in `main`) to `long`s. He also fixed it to compile with
clang by changing the args of main to be `int` and `char **`, respectively, and
changing specific references to the `argv` arg, casting to `long` (was `int` but
the 64-bit fix requires `long`) which was its old type. The original file, used
for demonstration purposes, as well as if you want to see if your system works
with the original code, is the alternate version. See the README.md for details.
Cody fixed this to work with both 64-bit and 32-bit compilers by changing most
of the `int`s (all but that in `main(int ...)`) to `long`s. He also fixed it to
compile with clang by changing the args of main to be `int` and `char **`,
respectively, and changing specific references to the `argv` arg, casting to
`long` (was `int` but the 64-bit fix requires `long`) which was its old type.
The original file, used for demonstration purposes, as well as if you want to
see if your system works with the original code, is the alternate version. See
the README.md for details.
For some reason the original code was missing (presumingly because it had been
added to `.gitignore` by accident) but Cody restored it from the archive.
## [2001/kev](2001/kev/kev.c) ([README.md](2001/kev/README.md]))