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)...
+> [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 all
+

There are two alternate versions that relate to the US specifically. See +Alternate code below.

Bugs and (Mis)features:

The current status of this entry is:

@@ -420,20 +422,35 @@ Location: US - United States of America

If lost:

    ./whereami.sh lat long

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:

    ./try.sh

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)…
+[A M E R I C A]…

+
+

That version, which will not compile with clang, is the second alternate +version, westley.alt2.c.

Alternate build:

    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:

    ./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:

The try.sh script uses both the original entry and the alternate code so one can try the same script for both:

@@ -555,6 +572,7 @@ joined together as one 160-character line and listed. You should see:

  • westley.c - entry source code
  • Makefile - entry Makefile
  • westley.alt.c - alternate source code
  • +
  • westley.alt2.c - one line alternate code that documents itself at 80 columns
  • westley.alt.orig.c - original source code
  • westley.orig.c - original source code
  • try.sh - script to try entry
  • diff --git a/1992/westley/westley.alt2.c b/1992/westley/westley.alt2.c new file mode 100644 index 000000000..a1feafb6c --- /dev/null +++ b/1992/westley/westley.alt2.c @@ -0,0 +1 @@ +main(l,a,n,d)char**a;{for(d=atoi(a[1])/2*80-atoi(a[2])-2043;n="bnaBCOCXdBBHGYdAP[A M E R I C A].AqandkmavX|ELC}BOCd"[l++-3];)for(;n-->64;)putchar(!d+++33^l&1);} diff --git a/1992/westley/westley.c b/1992/westley/westley.c old mode 100755 new mode 100644 diff --git a/bugs.html b/bugs.html index f65208cf0..293ca69b3 100644 --- a/bugs.html +++ b/bugs.html @@ -1252,18 +1252,6 @@ at 80 columns. However due to the nature of the program if the terminal is < in column width it will not display right. To see the number of columns in your terminal try:

        echo $COLUMNS
    -

    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).


    1993

    @@ -1289,7 +1277,7 @@ not exist in the archive. Do you have it? Please provide it!

    1993/cmills

    -

    STATUS: known bug - please help us fix

    +

    STATUS: known bug - please help us fix

    Source code: 1993/cmills/cmills.c

    Information: 1993/cmills/index.html

    In multiple platforms, both macOS and also linux (in particular a RHEL 9.3 @@ -1507,7 +1495,7 @@ if it checked for != EOF.

    1994/tvr

    -

    STATUS: known bug - please help us fix

    +

    STATUS: known bug - please help us fix

    Source code: 1994/tvr/tvr.c

    Information: 1994/tvr/index.html

    The judges said the following in their remarks:

    @@ -1540,7 +1528,7 @@ it calls getchar() via the pointer m. So this is a fea

    1995/leo

    -

    STATUS: known bug - please help us fix

    +

    STATUS: known bug - please help us fix

    Source code: 1995/leo/leo.c

    Information: 1995/leo/index.html

    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.

    2000/dlowe

    -

    STATUS: known bug - please help us fix

    +

    STATUS: known bug - please help us fix

    Source code: 2000/dlowe/dlowe.c

    Information: 2000/dlowe/index.html

    The author gives an example command:

    @@ -1984,7 +1972,7 @@ before the fixes there.

    Information: 2001/herrmann1/index.html

    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!

    -

    STATUS: known bug - please help us fix

    +

    STATUS: known bug - please help us fix

    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!

    2001/williams

    -

    STATUS: known bug - please help us fix

    +

    STATUS: known bug - please help us fix

    Source code: 2001/williams/williams.c

    Information: 2001/williams/index.html

    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!

    2014/vik

    -

    STATUS: known bug - please help us fix

    +

    STATUS: known bug - please help us fix

    Source code: 2014/vik/prog.c

    Information: 2014/vik/index.html

    Cody Boone Ferguson discovered a bug to do @@ -2968,7 +2956,7 @@ result. Error messages become garbled, though.

    2015/howe

    -

    STATUS: known bug - please help us fix

    +

    STATUS: known bug - please help us fix

    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 generated ioccc.json file.

    2018/mills

    -

    STATUS: known bug - please help us fix

    +

    STATUS: known bug - please help us fix

    Source code: 2018/mills/prog.c

    Information: 2018/mills/index.html

    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). - -


    # 1993 diff --git a/tmp/manifest.csv b/tmp/manifest.csv index 301307f23..ce8df8dba 100644 --- a/tmp/manifest.csv +++ b/tmp/manifest.csv @@ -829,6 +829,7 @@ 1992,westley,westley.c,20,true,c,true,entry source code 1992,westley,Makefile,30,true,makefile,true,entry Makefile 1992,westley,westley.alt.c,40,true,c,true,alternate source code +1992,westley,westley.alt2.c,45,true,c,true,one line alternate code that documents itself at 80 columns 1992,westley,westley.alt.orig.c,50,true,c,true,original source code 1992,westley,westley.orig.c,50,true,c,true,original source code 1992,westley,try.sh,100,true,shellscript,true,script to try entry diff --git a/tmp/manifest.numbers b/tmp/manifest.numbers index 5889f6f1a..f47f4c040 100644 Binary files a/tmp/manifest.numbers and b/tmp/manifest.numbers differ diff --git a/tmp/path_list.found.txt b/tmp/path_list.found.txt index 908d93634..f6f3e3c0e 100644 --- a/tmp/path_list.found.txt +++ b/tmp/path_list.found.txt @@ -835,6 +835,7 @@ 1992/westley/try.sh 1992/westley/westley.alt.c 1992/westley/westley.alt.orig.c +1992/westley/westley.alt2.c 1992/westley/westley.c 1992/westley/westley.orig.c 1992/westley/whereami.alt.sh diff --git a/tmp/path_list.manifest.txt b/tmp/path_list.manifest.txt index 908d93634..f6f3e3c0e 100644 --- a/tmp/path_list.manifest.txt +++ b/tmp/path_list.manifest.txt @@ -835,6 +835,7 @@ 1992/westley/try.sh 1992/westley/westley.alt.c 1992/westley/westley.alt.orig.c +1992/westley/westley.alt2.c 1992/westley/westley.c 1992/westley/westley.orig.c 1992/westley/whereami.alt.sh diff --git a/tmp/path_list.required.txt b/tmp/path_list.required.txt index 1526a78d6..86bb9dea3 100644 --- a/tmp/path_list.required.txt +++ b/tmp/path_list.required.txt @@ -545,6 +545,7 @@ 1992/westley/try.sh 1992/westley/westley.alt.c 1992/westley/westley.alt.orig.c +1992/westley/westley.alt2.c 1992/westley/westley.c 1992/westley/westley.orig.c 1992/westley/whereami.alt.sh