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.
This commit is contained in:
Cody Boone Ferguson committed 2023-04-09 06:07:08 -07:00
1 parent ec111b36f5
commit f95e8c6956
4 files changed
+156 -21

No files matched your search

+2 -2
View File
@@ -112,8 +112,8 @@ OBJ= ${PROG}.o
DATA=
TARGET= ${PROG}
#
ALT_OBJ=
ALT_TARGET=
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
#################
+36 -19
View File
@@ -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
<http://www.westley.org>
## 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
+107
View File
@@ -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);}
+11
View File
@@ -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