Change bug status of 2019/ciura, add scripts etc.
I'm almost positive that my earlier fixes to the scripts for the other
languages was all that is needed and the reason they don't work is due
to the dictionary and the fact that in some languages it is hard if not
impossible to form perfect pangrams especially with the entire alphabet.
This appears to be the case with German. A point of interest that I put
in the German scripts is:
# Are the umlauts ä, ö, ü and Eszett (ß) letters in the German alphabet? There
# is more than one opinion on the subject but a lot of words do have an umlaut
# (or Umlaut in German). In some (probably all) systems this script outputs
# nothing probably because it's very hard to form a perfect pangram in German,
# if it's not impossible. Nevertheless, we do include the other characters
# whether or not they are in your view considered part of the alphabet for the
# reason that so many words have them.
I put it 'if it's not impossible' because this also depends on what
letters are provided. These scripts give the entry every letter,
however, including those with diacritics so in the case of German it's
not going to work. It is possible to make it work if you remove some
letters or you give a word that has all the letters (but that kind of
defeats the purpose). As for the other languages I don't know if it's
possible or not (and I'm not fluent in German either - I just know
some). A search suggested it's possible in some other languages but the
author noted it's not in Spanish at least according to their estimates.
Nevertheless I believe that the fixes I made are all that's needed so
this entry now has INABIAF in the bugs.md file.
Fixed the Makefile so the alt version would actually build. Added
scripts to use the alt version instead.
Format/typo check README.md file.
Added try.sh and try.alt.sh.
Downloaded and converted the PS file linked to by the author to PDF and
added to repo.
This commit is contained in:
1 parent
85f9224c9b
commit
70b085933c
13 files changed
+197
-45
No files matched your search
+2
-2
@@ -112,8 +112,8 @@ OBJ= ${PROG}.o
|
||||
DATA= de.sh en.sh fr.sh getwords.sh it.sh pl.sh ru.sh wrapprog.py
|
||||
TARGET= ${PROG}
|
||||
#
|
||||
ALT_OBJ= ${PROG}.o
|
||||
ALT_TARGET= ${PROG}
|
||||
ALT_OBJ= ${PROG}.alt.o
|
||||
ALT_TARGET= ${PROG}.alt
|
||||
|
||||
|
||||
#################
|
||||
|
||||
+32
-21
@@ -5,12 +5,16 @@ make
|
||||
```
|
||||
|
||||
|
||||
There is an alternate version available. See [Alternate code](#alternate-code)
|
||||
below.
|
||||
|
||||
|
||||
### Bugs and (Mis)features:
|
||||
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: known bug - please help us fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
```
|
||||
|
||||
For more detailed information see [2019 ciura in bugs.md](/bugs.md#2019-ciura).
|
||||
@@ -26,34 +30,37 @@ For more detailed information see [2019 ciura in bugs.md](/bugs.md#2019-ciura).
|
||||
### Try:
|
||||
|
||||
```sh
|
||||
./getwords.sh en | grep .. | ./prog aeiouvwxyz
|
||||
./try.sh
|
||||
|
||||
./getwords.sh en | grep .. | ./prog aeiouhjklmnvwxyz
|
||||
|
||||
./getwords.sh en | grep .. | ./prog mrjocktvquizphdbagsfewlynx
|
||||
|
||||
./en.sh
|
||||
|
||||
./fr.sh
|
||||
|
||||
./ru.sh
|
||||
```
|
||||
|
||||
|
||||
## Alternate code:
|
||||
|
||||
There is an alternate version of this code that flushes stdout after writing a newline.
|
||||
See the Author's remarks for more information.
|
||||
There is an alternate version of this code that flushes `stdout` after writing a
|
||||
newline. See the Author's remarks for more information.
|
||||
|
||||
|
||||
### Alternate build:
|
||||
|
||||
To compile this alternate version:
|
||||
|
||||
```sh
|
||||
make alt
|
||||
```
|
||||
|
||||
|
||||
### Alternate use:
|
||||
|
||||
Use `prog.alt` as you would `prog` above.
|
||||
|
||||
|
||||
### Alternate try:
|
||||
|
||||
```sh
|
||||
./try.alt.sh
|
||||
```
|
||||
|
||||
|
||||
## Judges' remarks:
|
||||
|
||||
A few letters, one at a time, with no repeats. How many different ways can this
|
||||
@@ -105,21 +112,24 @@ This entry implements Algorithm X (_Exact cover via dancing links_)
|
||||
from Section 7.2.2.1 in fascicle 5C of _The Art of Computer
|
||||
Programming_ by Donald E. Knuth. As of June 2019, you can download an
|
||||
incomplete draft of the fascicle from [Knuth's
|
||||
website](https://www-cs-faculty.stanford.edu/~knuth/fasc5c.ps.gz).
|
||||
website](https://www-cs-faculty.stanford.edu/~knuth/fasc5c.ps.gz), converted to
|
||||
PDF as [fasc5c.pdf](fasc5c.pdf) for your convenience.
|
||||
|
||||
|
||||
### Usage:
|
||||
|
||||
`./prog LETTERS [N]`
|
||||
|
||||
reads allowed words from standard input and writes perfect pangrams
|
||||
with at most _N_ words composed of _LETTERS_ to standard output, one
|
||||
per line. If _N_ is not given, the number of words in the pangrams is
|
||||
unlimited. The characters in _LETTERS_ must not repeat. The length of
|
||||
_LETTERS_ must not exceed 97 characters.
|
||||
with at most `N` words composed of `LETTERS` to standard output, one
|
||||
per line. If `N` is not given, the number of words in the pangrams is
|
||||
unlimited. The characters in `LETTERS` must not repeat. The length of
|
||||
`LETTERS` must not exceed 97 characters.
|
||||
|
||||
The exit status is 0 if no error occurred, 1 if the input word list
|
||||
is too long, and 2 if the command-line arguments are missing.
|
||||
|
||||
|
||||
### Helper scripts:
|
||||
|
||||
- [getwords.sh](getwords.sh)
|
||||
@@ -143,6 +153,7 @@ is too long, and 2 if the command-line arguments are missing.
|
||||
English, French, Italian, Polish, and Russian perfect pangrams, respectively.
|
||||
They require a UTF-8 locale.
|
||||
|
||||
|
||||
### Miscellaneous remarks:
|
||||
|
||||
I dare submit this entry to categories _algorithms_,
|
||||
@@ -151,7 +162,7 @@ among the programs that won IOCCC in the past), and _obscure bugs_ (see
|
||||
the questions about Linux core dumps below).
|
||||
|
||||
To a casual eye, this entry may look similar to
|
||||
[2005 klausler](https://www.ioccc.org/years.html#2005_klausler).
|
||||
[2005/klausler](/2005/klausler/README.md).
|
||||
However, `prog` is internationalized and way faster. On my machine,
|
||||
`./klausler abcdefghijklmnopqrstuvwxyz` printed only 3,965 perfect
|
||||
pangrams until I killed it after 144 hours running, while the
|
||||
@@ -181,7 +192,7 @@ Why does `yes | ./prog y` hang on Linux? Change `static int` to
|
||||
`#define P 9<<23^1` to `#define P 9<<23` and recompile
|
||||
`prog`. Why does `yes | ./prog y` exit gracefully?
|
||||
|
||||
Answer: Nf bs Whar 2019, guhf znavsrfg ohtf va `tyvop` 2.22--2.29:
|
||||
Answer: As of June 2019, thus manifest bugs in `glibc` 2.22--2.29:
|
||||
[1](https://sourceware.org/bugzilla/show_bug.cgi?id=20568) naq
|
||||
[2](https://sourceware.org/bugzilla/show_bug.cgi?id=20632).
|
||||
|
||||
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Are the umlauts ä, ö, ü and Eszett (ß) letters in the German alphabet? There
|
||||
# is more than one opinion on the subject but a lot of words do have an umlaut
|
||||
# (or Umlaut in German). In some (probably all) systems this script outputs
|
||||
# nothing probably because it's very hard to form a perfect pangram in German,
|
||||
# if it's not impossible. Nevertheless, we do include the other characters
|
||||
# whether or not they are in your view considered part of the alphabet for the
|
||||
# reason that so many words have them.
|
||||
|
||||
LC_ALL=C ./getwords.sh de | LC_ALL=C grep .. | LC_ALL=C ./prog.alt aäbcdefghijklmnoöpqrsßtuüvwxyz
|
||||
+10
-2
@@ -1,3 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -x
|
||||
LC_ALL=C ./getwords.sh de | LC_ALL=C tr '[:lower:]' '[:upper:]' | LC_ALL=C grep .. | LC_ALL=C ./prog aäbcdefghijklmnoöpqrsßtuüvwxyz
|
||||
#
|
||||
# Are the umlauts ä, ö, ü and Eszett (ß) letters in the German alphabet? There
|
||||
# is more than one opinion on the subject but a lot of words do have an umlaut
|
||||
# (or Umlaut in German). In some (probably all) systems this script outputs
|
||||
# nothing probably because it's very hard to form a perfect pangram in German,
|
||||
# if it's not impossible. Nevertheless, we do include the other characters
|
||||
# whether or not they are in your view considered part of the alphabet for the
|
||||
# reason that so many words have them.
|
||||
|
||||
LC_ALL=C ./getwords.sh de | LC_ALL=C grep .. | LC_ALL=de_DE.UTF-8 ./prog aäbcdefghijklmnoöpqrsßtuüvwxyz
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -x
|
||||
./getwords.sh en | grep .. | ./prog.alt abcdefghijklmnopqrstuvwxyz
|
||||
Binary file not shown.
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
(>&2 echo "Please be patient. Extracting Italian words")
|
||||
(>&2 echo "from aspell takes a few minutes.")
|
||||
set -x
|
||||
LC_ALL=C ./getwords.sh it | LC_ALL=C grep .. | LC_ALL=C ./prog.alt aàbcdeèéfghiìlmnoòpqrstuùvz #jkwxy
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -x
|
||||
LC_ALL=C ./getwords.sh pl | LC_ALL=C grep -vE '^[^aiouwz]$' | LC_ALL= ./prog.alt aąbcćdeęfghijklłmnńoóprsśtuwyzźż
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -x
|
||||
LC_ALL=C ./getwords.sh ru | LC_ALL=C ./prog.alt абвгдеёжзийклмнопрстуфхцчшщъыьэюя
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate IOCCC winner 2019/ciura alt code
|
||||
#
|
||||
|
||||
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
|
||||
# this way allows us to have the user specify a different compiler in an easy
|
||||
# way.
|
||||
if [[ -z "$CC" ]]; then
|
||||
CC="cc"
|
||||
fi
|
||||
|
||||
make CC="$CC" everything >/dev/null || exit 1
|
||||
|
||||
# clear screen after compilation so that only the entry is shown
|
||||
clear
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./getwords.sh en | grep .. | ./prog.alt aeiouvwxyz: "
|
||||
./getwords.sh en | grep .. | ./prog.alt aeiouvwxyz | less -EXF
|
||||
echo 1>&2
|
||||
|
||||
echo "$ ./getwords.sh en | grep .. | ./prog.alt aeiouhjklmnvwxyz" 1>&2
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
echo 1>&2
|
||||
./getwords.sh en | grep .. | ./prog.alt aeiouhjklmnvwxyz | less -EXF
|
||||
|
||||
echo "$ ./getwords.sh en | grep .. | ./prog.alt mrjocktvquizphdbagsfewlynx | head -n 256" 1>&2
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
echo 1>&2
|
||||
./getwords.sh en | grep .. | ./prog.alt mrjocktvquizphdbagsfewlynx | head -n 256 | less -EXF
|
||||
|
||||
|
||||
echo "$ ./en.alt.sh" 1>&2
|
||||
echo "There will likely be a lot of output. Quit when bored. No logophiles will be hurt." 1>&2
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
./en.alt.sh | less -EXF
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate IOCCC winner 2019/ciura
|
||||
#
|
||||
|
||||
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
|
||||
# this way allows us to have the user specify a different compiler in an easy
|
||||
# way.
|
||||
if [[ -z "$CC" ]]; then
|
||||
CC="cc"
|
||||
fi
|
||||
|
||||
make CC="$CC" all >/dev/null || exit 1
|
||||
|
||||
# clear screen after compilation so that only the entry is shown
|
||||
clear
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./getwords.sh en | grep .. | ./prog aeiouvwxyz: "
|
||||
./getwords.sh en | grep .. | ./prog aeiouvwxyz | less -EXF
|
||||
echo 1>&2
|
||||
|
||||
echo "$ ./getwords.sh en | grep .. | ./prog aeiouhjklmnvwxyz" 1>&2
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
echo 1>&2
|
||||
./getwords.sh en | grep .. | ./prog aeiouhjklmnvwxyz | less -EXF
|
||||
|
||||
echo "$ ./getwords.sh en | grep .. | ./prog mrjocktvquizphdbagsfewlynx | head -n 256" 1>&2
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
echo 1>&2
|
||||
./getwords.sh en | grep .. | ./prog mrjocktvquizphdbagsfewlynx | head -n 256 | less -EXF
|
||||
|
||||
|
||||
echo "$ ./en.sh" 1>&2
|
||||
echo "There will likely be a lot of output. Quit when bored. No logophiles will be hurt." 1>&2
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
./en.sh | less -EXF
|
||||
Reference in new issue
Block a user