From 142a2f2863e01ec18786100adf9016a9dcc1995a Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 17 Nov 2023 05:23:54 -0800 Subject: [PATCH] Make 1985/sicherman even more like original There were some places that macros could be used and some commented code could be removed to make it more like the original too. --- 1985/sicherman/sicherman.c | 7 +++---- thanks-for-fixes.md | 11 ++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/1985/sicherman/sicherman.c b/1985/sicherman/sicherman.c index e5628c96f..77c825b67 100644 --- a/1985/sicherman/sicherman.c +++ b/1985/sicherman/sicherman.c @@ -12,10 +12,9 @@ char **V; * up.) (In the C Manual)*/ { char _,__; - while (read(0,&__,1) & write((_=(_=~' '&__,/*/)), - _C_,1)) _=/*/-('\b'b'\b'>=_|_>'\t'b'\n'))?__:__-_+ - '\b'b'\b'|((_-52)%('\b'b'\b'+~' '&'\t'b'\n')+1),1), - &_,1))_=0/*C-*V+subr(&V)*/; + while (read(0,&__,1) & write((_=(_=C_C_(__),- + ('\b'b'\b'>=C_C>'\t'b'\n'))?__:__-_+'\b'b'\b'| + ((_-52)%('\b'b'\b'+~' '&'\t'b'\n')+1),1),&_,1))_=0; } subr(C) diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 3002ee48e..fc9d322b5 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -426,15 +426,16 @@ replaced for actual code so that instead of having the while loop condition as: we have it as: - while (read(0,&__,1) & write((_=(_=~' '&__,/*/)), - _C_,1)) _=/*/-('\b'b'\b'>=_|_>'\t'b'\n'))?__:__-_+ - '\b'b'\b'|((_-52)%('\b'b'\b'+~' '&'\t'b'\n')+1),1), - &_,1))_=0/*C-*V+subr(&V)*/; + while (read(0,&__,1) & write((_=(_=C_C_(__),- + ('\b'b'\b'>=C_C>'\t'b'\n'))?__:__-_+'\b'b'\b'| + ((_-52)%('\b'b'\b'+~' '&'\t'b'\n')+1),1),&_,1))_=0; + + Note how numerous of the macros can still be used but some cannot. - Finally, the function `subr()` cannot, as the above shows, be called in the body of the `while()` loop as calling it will result in incorrect output, once you even get it to compile (involving a cast, for instance, amongst other ways). -Note though that we can still assign to the `\_` but we can't assign by calling +Note though that we can still assign to the `_` but we can't assign by calling the function.