From f95e8c6956aa39440a199e7362a73d8688543b81 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 06:07:08 -0700 Subject: [PATCH] Updates and fixes + add alt code in 1990/westley Fix formatting in README.md. Removed statement of judges that they fixed it for modern compilers that object to 's' added to an int for short int as this is what I did and the source that was imported had not been fixed though this might have been a simple mistake. I had not noticed this before. Update bugs.md: a known bug and one INABIAF (crashes on no arg). Added alt code with the 1s as it's instructive to show what was once allowed but is not now. --- 1990/westley/Makefile | 4 +- 1990/westley/README.md | 55 ++++++++++++------- 1990/westley/westley.alt.c | 107 +++++++++++++++++++++++++++++++++++++ bugs.md | 11 ++++ 4 files changed, 156 insertions(+), 21 deletions(-) create mode 100644 1990/westley/westley.alt.c diff --git a/1990/westley/Makefile b/1990/westley/Makefile index 20790d8d0..a305416b1 100644 --- a/1990/westley/Makefile +++ b/1990/westley/Makefile @@ -112,8 +112,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= -ALT_TARGET= +ALT_OBJ= ${PROG}.alt.o +ALT_TARGET= ${PROG}.alt ################# diff --git a/1990/westley/README.md b/1990/westley/README.md index 780473d98..1b805fe24 100644 --- a/1990/westley/README.md +++ b/1990/westley/README.md @@ -1,23 +1,28 @@ # Best Layout - Brian Westley (Merlyn LeRoy on usenet) - DigiBoard, Inc. - 1026 Blair Ave. - St. Paul, MN 55104 - USA - - http://www.westley.org +Brian Westley (Merlyn LeRoy on usenet) +DigiBoard, Inc. +1026 Blair Ave. +St. Paul, MN 55104 +USA + ## To build: - make all +```sh +make all +``` ## To run: - ./westley number +```sh +./westley number +``` [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for modern -systems. Thank you Cody for your assistance! +systems. It had `1s` in places for a short int which was changed to just `1`. +Since it's instructional to see the differences he has provided an alternate +version with the original code. See below. Thank you Cody for your assistance! NOTE: this entry will segfault without an arg and will enter an infinite loop if input is not a positive number. @@ -25,12 +30,27 @@ input is not a positive number. ## Try: - ./westley 1 - ./westley 2 - ./westley 3 - ./westley 5 +```sh +./westley 1 +./westley 2 +./westley 3 +./westley 5 +``` -## Judges' comments +### Alternate code: + +To see how C has changed over the years Cody provided the original source in +[westley.alt.c](westley.alt.c). If you have an old enough compiler try: + + +```sh +make alt +``` + +Use `westley.alt` as you would `westley`. + + +## Judges' comments: If you would rather "Daisy" someone other than Westley, rename @@ -49,11 +69,8 @@ The original source had control-L's after each code block. To make it easier on news readers, we converted each control-L to a blank line. -Some modern compilers will not accept '1s' as a short integer - for -these compilers we replaced the instances of `1s` with `1`. - -## Author's comments +## Author's comments: This is a "Picking the Daisy" simulation. Now, instead of mangling a daisy, simply run this program with the number of petals desired as diff --git a/1990/westley/westley.alt.c b/1990/westley/westley.alt.c new file mode 100644 index 000000000..5d63757cc --- /dev/null +++ b/1990/westley/westley.alt.c @@ -0,0 +1,107 @@ +char*lie; + + double time, me= !0XFACE, + + not; int rested, get, out; + + main(ly, die) char ly, **die ;{ + + signed char lotte, + + +dear; (char)lotte--; + + for(get= !me;; not){ + + 1 - out & out ;lie;{ + + char lotte, my= dear, + + **let= !!me *!not+ ++die; + + (char*)(lie= + + +"The gloves are OFF this time, I detest you, snot\n\0sed GEEK!"); + + do {not= *lie++ & 0xF00L* !me; + + #define love (char*)lie - + + love 1s *!(not= atoi(let + + [get -me? + + (char)lotte- + + +(char)lotte: my- *love - + + 'I' - *love - 'U' - + + 'I' - (long) - 4 - 'U' ])- !! + + (time =out= 'a'));} while( my - dear + + && 'I'-1l -get- 'a'); break;}} + + (char)*lie++; + + +(char)*lie++, (char)*lie++; hell:0, (char)*lie; + + get *out* (short)ly -0-'R'- get- 'a'^rested; + + do {auto*eroticism, + + that; puts(*( out + + - 'c' + +-('P'-'S') +die+ -2 ));}while(!"you're at it"); + + +for (*((char*)&lotte)^= + + (char)lotte; (love ly) [(char)++lotte+ + + !!0xBABE];){ if ('I' -lie[ 2 +(char)lotte]){ 'I'-1l ***die; } + + else{ if ('I' * get *out* ('I'-1l **die[ 2 ])) *((char*)&lotte) -= + + '4' - ('I'-1l); not; for(get=! + + +get; !out; (char)*lie & 0xD0- !not) return!! + + (char)lotte;} + + +(char)lotte; + + do{ not* putchar(lie [out + + *!not* !!me +(char)lotte]); + + not; for(;!'a';);}while( + + love (char*)lie);{ + + +register this; switch( (char)lie + + [(char)lotte] -1s *!out) { + + char*les, get= 0xFF, my; case' ': + + *((char*)&lotte) += 15; !not +(char)*lie*'s'; + + this +1s+ not; default: 0xF +(char*)lie;}}} + + get - !out; + + if (not--) + + goto hell; + + exit( (char)lotte);} diff --git a/bugs.md b/bugs.md index 0d559c05b..c019ae999 100644 --- a/bugs.md +++ b/bugs.md @@ -477,6 +477,17 @@ this entry that prevented it from working. However if not enough args are specified this program will crash. This should NOT be fixed. +## [1990/westley](1990/westley/westley.c) ([README.md](1990/westley/README.md)) +## STATUS: INABIAF - please **DO NOT** fix + +This entry will crash without an arg. At this time this is not considered worth +fixing so it should not be fixed. + +## STATUS: known bug - please help us fix + +However a negative number will make the program enter an infinite loop. This +will be fixed in time but it's noted here for now. + # 1991