From 81c606bab164b7841f449918aac61dca9650170a Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 8 Oct 2023 03:59:46 -0700 Subject: [PATCH 1/2] Restore 1986/hague to original By accident the hague.alt.c was copied to hague.c. --- 1986/hague/hague.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1986/hague/hague.c b/1986/hague/hague.c index c5dc9dba3..bf43532b3 100644 --- a/1986/hague/hague.c +++ b/1986/hague/hague.c @@ -4,7 +4,7 @@ #define DITDAH * #define DAHDIT for #define DIT_DAH malloc -#define DAH_DIT fgets +#define DAH_DIT gets #define _DAHDIT char _DAHDIT _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?e'b.s;i,d:" ;main DIT DAH{_DAHDIT @@ -12,7 +12,7 @@ DITDAH _DIT,DITDAH DAH_,DITDAH DIT_, DITDAH _DIT_,DITDAH DIT_DAH DIT DAH,DITDAH DAH_DIT DIT DAH;DAHDIT DIT _DIT=DIT_DAH DIT 81 DAH,DIT_=_DIT -__DAH;_DIT=DAH_DIT DIT _DIT,81,stdin DAH,_DIT[strlen(_DIT)-1]='\0',_DIT!=NULL;__DIT +__DAH;_DIT==DAH_DIT DIT _DIT DAH;__DIT DIT'\n'DAH DAH DAHDIT DIT DAH_=_DIT;DITDAH DAH_;__DIT DIT DITDAH _DIT_?_DAH DIT DITDAH DIT_ DAH:'?'DAH,__DIT From b99bd2f6fbc915e9a4df86258919256d82cf675d Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 8 Oct 2023 04:04:37 -0700 Subject: [PATCH 2/2] Add 2>/dev/null to try in 1986/hague Until such a time that the alt code can become the main code, to be safer and more importantly to prevent obnoxious warnings that are shown at runtime, the 2>/dev/null will prevent the runtime warning from showing up; this is particularly 'necessary' for macOS as it is the one that shows the warning and this entry is more complicated to set up fgets() though I do have some ideas on how it might be done but 'might' is a somewhat big if: it's probably in this case going to be tampering too much with the entry when the benefit is not that worth it since we can redirect the warning to /dev/null. This is TBD later. --- 1986/hague/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1986/hague/README.md b/1986/hague/README.md index 9b01d231f..333fe3139 100644 --- a/1986/hague/README.md +++ b/1986/hague/README.md @@ -16,14 +16,14 @@ it is worth having as an alternate version. ## To run: ```sh -./hague +./hague 2>/dev/null # enter some text ``` ## Try: ```sh -./hague +./hague 2>/dev/null IOCCC International Obfuscated C Code Contest Jim Hague @@ -32,7 +32,7 @@ Jim Hague Also try: ```sh -echo IOCCC | ./hague +echo IOCCC | ./hague 2>/dev/null ``` ### Alternate code: