diff --git a/1992/westley/.entry.json b/1992/westley/.entry.json
index c649086e4..cc20c2dab 100644
--- a/1992/westley/.entry.json
+++ b/1992/westley/.entry.json
@@ -33,6 +33,14 @@
"display_via_github" : true,
"entry_text" : "alternate source code"
},
+ {
+ "file_path" : "westley.alt2.c",
+ "inventory_order" : 45,
+ "OK_to_edit" : true,
+ "display_as" : "c",
+ "display_via_github" : true,
+ "entry_text" : "one line alternate code that documents itself at 80 columns"
+ },
{
"file_path" : "westley.alt.orig.c",
"inventory_order" : 50,
diff --git a/1992/westley/.gitignore b/1992/westley/.gitignore
index b2b7df607..cfeb0c8da 100644
--- a/1992/westley/.gitignore
+++ b/1992/westley/.gitignore
@@ -7,6 +7,7 @@ indent.o
prog.orig
westley
westley.alt
+westley.alt2
westley.orig
whereami
whereami.alt
diff --git a/1992/westley/Makefile b/1992/westley/Makefile
index 745efb88b..134d76725 100644
--- a/1992/westley/Makefile
+++ b/1992/westley/Makefile
@@ -135,17 +135,25 @@ all: data ${TARGET}
${PROG}: ${PROG}.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
${LN} -sf ${PROG} whereami
- @echo "NOTE: your terminal must be at least 80 columns wide for this to work right"
+ @echo "NOTE: your terminal must be AT LEAST 80 columns wide for this to work right"
# alternative executable
#
alt: data ${ALT_TARGET}
@${TRUE}
+alt2: data ${ALT_TARGET}2
+ @${TRUE}
+
${PROG}.alt: ${PROG}.alt.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
${LN} -sf ${PROG}.alt whereami.alt
- @echo "NOTE: your terminal must be at least 80 columns wide for this to work right"
+ @echo "NOTE: your terminal must be AT LEAST 80 columns wide for this to work right"
+
+${PROG}.alt2: ${PROG}.alt2.c
+ ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
+ ${LN} -sf ${PROG}.alt whereami.alt2
+ @echo "NOTE: your terminal must WRAP AT 80 columns this to work right"
# data files
@@ -213,9 +221,9 @@ clean:
fi
clobber: clean
- ${RM} -f ${TARGET} ${ALT_TARGET}
+ ${RM} -f ${TARGET} ${ALT_TARGET} ${ALT_TARGET}2
${RM} -rf *.dSYM
- ${RM} -f whereami whereami.alt
+ ${RM} -f whereami whereami.alt whereami.alt2
@-if [ -e sandwich ]; then \
${RM} -f sandwich; \
echo 'ate sandwich'; \
diff --git a/1992/westley/README.md b/1992/westley/README.md
index f8549429d..41f78d260 100644
--- a/1992/westley/README.md
+++ b/1992/westley/README.md
@@ -4,6 +4,9 @@
make all
```
+There are two alternate versions that relate to the US specifically. See
+[Alternate code](#alternate-code) below.
+
### Bugs and (Mis)features:
@@ -26,10 +29,8 @@ If lost:
Where `lat` and `long` correspond to your latitude and longitude.
-**NOTE**: you **MUST** have a terminal that is at least 80 columns for this to show
-properly. The `whereami.sh` and `whereami.alt.sh` scripts check this but if you
-do not have such a terminal you can run the `whereami` (or for the alternate code
-described below, `whereami.alt`) directly.
+**NOTE**: you **MUST** have a terminal that is **at least 80 columns** for this
+to show properly. The `whereami.sh` and `whereami.alt.sh` scripts check this.
## Try:
@@ -41,7 +42,17 @@ described below, `whereami.alt`) directly.
## Alternate code:
-The author provided a version for the US which we added.
+The author provided a version for the US which we added in two files: the first
+one is fixed to work for clang; the second one is more for show than for use: if
+you have your terminal set at 80 columns you will see that the source code
+documents itself. The author explains this but what is meant is it will look
+like:
+
+> main(l,a,n,d)... There are two alternate versions that relate to the US specifically. See
+Alternate code below. The current status of this entry is: If lost: Where NOTE: you MUST have a terminal that is at least 80 columns for this to show
-properly. The NOTE: you MUST have a terminal that is at least 80 columns for this
+to show properly. The The author provided a version for the US which we added. The author provided a version for the US which we added in two files: the first
+one is fixed to work for clang; the second one is more for show than for use: if
+you have your terminal set at 80 columns you will see that the source code
+documents itself. The author explains this but what is meant is it will look
+like: main(l,a,n,d)… That version, which will not compile with If you have NOTE: this alternative version also needs a terminal with at least 80 columns
-but if you do not have such a terminal you can run NOTE: this alternative version also needs a terminal with at least 80
+columns. The try.sh script uses both the original
entry and the alternate code so one can try the same script for both:
+> [A M E R I C A]...
+
+That version, which will not compile with `clang`, is the second alternate
+version, [westley.alt2.c](%%REPO_URL%%/1992/westley/westley.alt2.c).
### Alternate build:
@@ -50,6 +61,18 @@ The author provided a version for the US which we added.
make alt
```
+If you have `gcc` you can also compile the second alternate version, though it
+is functionally equivalent to the first. The original limitation where one has
+to have a terminal that wraps at 80 columns is unfortunately in this version
+because it requires a specific length so if you do not have this it will not
+look right; use the first alternate version if you want to see correct output
+with wider terminals.
+
+
+```
+ make alt2
+```
+
### Alternate use:
@@ -57,8 +80,8 @@ The author provided a version for the US which we added.
./whereami.alt.sh lat long
```
-**NOTE**: this alternative version also needs a terminal with at least 80 columns
-but if you do not have such a terminal you can run `whereami.alt` directly.
+**NOTE**: this alternative version also needs a terminal with **at least 80
+columns**.
### Alternate try:
diff --git a/1992/westley/index.html b/1992/westley/index.html
index a6e27f014..edf56463e 100644
--- a/1992/westley/index.html
+++ b/1992/westley/index.html
@@ -409,6 +409,8 @@ Location: US - United States of America
To build:
+ make allBugs and (Mis)features:
@@ -420,20 +422,35 @@ Location: US - United States of America
./whereami.sh lat longlat and long correspond to your latitude and longitude.whereami.sh and whereami.alt.sh scripts check this but if you
-do not have such a terminal you can run the whereami (or for the alternate code
-described below, whereami.alt) directly.whereami.sh and whereami.alt.sh scripts check this.Try:
./try.shAlternate code:
-
+
+
+[A M E R I C A]…clang, is the second alternate
+version, westley.alt2.c.Alternate build:
+ make altgcc you can also compile the second alternate version, though it
+is functionally equivalent to the first. The original limitation where one has
+to have a terminal that wraps at 80 columns is unfortunately in this version
+because it requires a specific length so if you do not have this it will not
+look right; use the first alternate version if you want to see correct output
+with wider terminals. make alt2Alternate use:
- ./whereami.alt.sh lat longwhereami.alt directly.Alternate try:
echo $COLUMNS
-The author suggested that the alternate version, which Cody added (but fixed for -modern systems), should print
- main(l,a,n,d)...
- [A M E R I C A]...
-…going down the left edge if your terminal auto-wraps at 80 characters.
-This however does not seem to work. It does not appear to be because of the fix -for modern systems as it doesn’t work for gcc either, even before any changes. -This might be a misunderstanding or it might be that having 80 columns (resized) -does not count (though the output before the fix of the 80 column requirement -showed was correct when at 80-columns so it seems like this could be a bug if -it’s not a misunderstanding).
In multiple platforms, both macOS and also linux (in particular a RHEL 9.3
@@ -1507,7 +1495,7 @@ if it checked for != EOF.
The judges said the following in their remarks:
@@ -1540,7 +1528,7 @@ it callsgetchar() via the pointer m. So this is a fea
The judges suggested that the following commands should result in output:
@@ -1693,7 +1681,7 @@ is in the index.html file as something to try and ponder.The author gives an example command:
@@ -1984,7 +1972,7 @@ before the fixes there.The author referred to the file herrmann1.turing but it does not exist not even
in the archive. Do you have a copy? Please provide it!
There is also a bug in part. During compilation you’re supposed to see some animation but this does not seem to work with modern gcc versions. It appears that version 2.95 works but maybe others do as well. Do you have a fix? We would @@ -2060,7 +2048,7 @@ it? Please provide it!
There seem to be a couple bugs at least in this entry. The first one is that @@ -2909,7 +2897,7 @@ player become bigger, stay away from blocks!
Cody Boone Ferguson discovered a bug to do @@ -2968,7 +2956,7 @@ result. Error messages become garbled, though.
The test scripts do not seem to work properly with bash but this would be ideal as not all systems have a compatible shell (they assume a POSIX compliant shell). One, with bash, might see:
@@ -3063,7 +3051,7 @@ fixing the syntax error in the generatedioccc.json file.
After exiting the program (with ctrl-e) if you try running it again you will diff --git a/bugs.md b/bugs.md index 4f5ad161d..09a511080 100644 --- a/bugs.md +++ b/bugs.md @@ -1230,26 +1230,6 @@ terminal try: ``` -### STATUS: known bug - please help us fix - -The author suggested that the alternate version, which Cody added (but fixed for -modern systems), should print - -``` - main(l,a,n,d)... - [A M E R I C A]... -``` - -...going down the left edge if your terminal auto-wraps at 80 characters. - -This however does not seem to work. It does not appear to be because of the fix -for modern systems as it doesn't work for gcc either, even before any changes. -This might be a misunderstanding or it might be that having 80 columns (resized) -does not count (though the output before the fix of the 80 column requirement -showed was correct when at 80-columns so it seems like this could be a bug if -it's not a misunderstanding). - -