Format/typo check 1993/schnitzi + update bugs.md
This commit is contained in:
1 parent
959d1559be
commit
7f90bed520
2 files changed
+92
-27
No files matched your search
+36
-27
@@ -5,6 +5,18 @@ make all
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Bugs and (Mis)features:
|
||||||
|
|
||||||
|
The current status of this entry is:
|
||||||
|
|
||||||
|
```
|
||||||
|
STATUS: INABIAF - please **DO NOT** fix
|
||||||
|
```
|
||||||
|
|
||||||
|
For more detailed information see [1993 schnitzi in bugs.md](/bugs.md#1993-schnitzi).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## To use:
|
## To use:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -16,14 +28,7 @@ where
|
|||||||
|
|
||||||
`file` is a file containing some text.
|
`file` is a file containing some text.
|
||||||
|
|
||||||
This entry will segfault if the file cannot be opened. This is not a bug.
|
Certain input will cause the program to fail as described in the bugs.md file.
|
||||||
|
|
||||||
This is supposed to happen. As is written in the
|
|
||||||
[The Jargon File](http://catb.org/jargon/html/F/feature.html):
|
|
||||||
|
|
||||||
```
|
|
||||||
That's not a bug, that's a feature.
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### Try:
|
### Try:
|
||||||
@@ -33,13 +38,15 @@ That's not a bug, that's a feature.
|
|||||||
# ask some questions suggested by the author, noted below
|
# ask some questions suggested by the author, noted below
|
||||||
```
|
```
|
||||||
|
|
||||||
We also suggest you ask the program:
|
We also suggest you ask the program the following questions:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
Who is Mark Schnitzus?
|
Who is Mark Schnitzus?
|
||||||
|
|
||||||
|
Who was Jack the Ripper ?
|
||||||
```
|
```
|
||||||
|
|
||||||
Notice how it still manages to answer the question despite there being an
|
Notice how it still manages to answer the first question despite there being an
|
||||||
intentional spelling error there.
|
intentional spelling error there.
|
||||||
|
|
||||||
Try feeding the program source to the program and ask both:
|
Try feeding the program source to the program and ask both:
|
||||||
@@ -49,6 +56,9 @@ What is cat ?
|
|||||||
What is cat?
|
What is cat?
|
||||||
```
|
```
|
||||||
|
|
||||||
|
What happens if you ask it other questions with and without a space before the
|
||||||
|
`?`?
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
@@ -64,16 +74,14 @@ The author suggests the following questions when using
|
|||||||
- What language is it written in?
|
- What language is it written in?
|
||||||
- Has the Loch Ness monster really been captured?
|
- Has the Loch Ness monster really been captured?
|
||||||
- Who was Hitler?
|
- Who was Hitler?
|
||||||
- Were the NASA moon landings faked?
|
- Were the NASA Moon landings faked?
|
||||||
- Is it true that Elvis is alive?
|
- Is it true that Elvis is alive?
|
||||||
- Do colorless green ideas sleep furiously?
|
- Do colorless green ideas sleep furiously?
|
||||||
|
|
||||||
We suggest you try using the body (minus the header and signature line)\
|
We suggest you try using the body (minus the header and signature line)
|
||||||
of a Usenet article. You might want to try something from alt.flame. :-)
|
of a Usenet article. You might want to try something from alt.flame. :-)
|
||||||
|
|
||||||
NOTE: If you have a ' in the question this entry might fail.
|
NOTE: If you have certain `'` in the question this entry might fail.
|
||||||
|
|
||||||
NOTE: The author may also be contacted at: marks@aldrin.ksc.nasa.gov.
|
|
||||||
|
|
||||||
|
|
||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
@@ -84,27 +92,28 @@ text file. I thought this might be a complicated task, and I was
|
|||||||
right -- it took me over 800 bytes. Of course, it doesn't always
|
right -- it took me over 800 bytes. Of course, it doesn't always
|
||||||
work, but that's AI for you.
|
work, but that's AI for you.
|
||||||
|
|
||||||
This program accepts the name of a text file as the first
|
This program accepts the name of a text file as the first parameter. For
|
||||||
parameter. For example, to run it on the supplied data file called
|
example, to run it on the supplied data file called 'schnitzi.info' you would
|
||||||
'info' you would type `./schnitzi info`. It echoes the file, then
|
type `./schnitzi schnitzi.info`. It echoes the file, then gives you a prompt
|
||||||
gives you a prompt where you may type in questions about that text.
|
where you may type in questions about that text. The more words you use which
|
||||||
The more words you use which are actually present in the text file,
|
are actually present in the text file, the better results you get. You'll need
|
||||||
the better results you get. You'll need to hit `ctrl-c` to break out
|
to hit `ctrl-c` to break out of the program. Just hitting `return` at the
|
||||||
of the program. Just hitting `return` at the prompt will reprint the
|
prompt will reprint the paragraph.
|
||||||
paragraph.
|
|
||||||
|
|
||||||
If you're curious as to how it works, I guess you could feed in the
|
If you're curious as to how it works, I guess you could feed in the
|
||||||
source as the input file and ask "How does this work?" at the prompt,
|
source as the input file and ask "How does this work?" at the prompt,
|
||||||
but I'm not guaranteeing any results...
|
but I'm not guaranteeing any results...
|
||||||
|
|
||||||
|
|
||||||
### Compilation notes
|
### Compilation notes
|
||||||
|
|
||||||
- The use of 'strcasecmp' may be non-standard. 'strcmp' can be substituted for
|
- The use of `strcasecmp(3)` may be non-standard. `strcmp(3)` can be substituted for
|
||||||
it, with a slight performance penalty.
|
it, with a slight performance penalty.
|
||||||
|
|
||||||
- This program depends on the first command-line parameter, typically called
|
- This program depends on the first command-line parameter, typically called
|
||||||
argv[0], to hold the name of the executable. It is my understanding that this
|
`argv[0]`, to hold the name of the executable. It is my understanding that this
|
||||||
property of argv[0] is not guaranteed on some systems.
|
property of `argv[0]` is not guaranteed on some systems.
|
||||||
|
|
||||||
|
|
||||||
### Obfuscation
|
### Obfuscation
|
||||||
|
|
||||||
@@ -113,7 +122,7 @@ property of argv[0] is not guaranteed on some systems.
|
|||||||
- The layout, variable names, and expression format have been chosen in such a
|
- The layout, variable names, and expression format have been chosen in such a
|
||||||
way as to cause visual confusion.
|
way as to cause visual confusion.
|
||||||
|
|
||||||
- It uses uses external `system()` calls to echo the text file and break up the
|
- It uses uses external `system(3)` calls to echo the text file and break up the
|
||||||
question into individual words with a recursive call.
|
question into individual words with a recursive call.
|
||||||
|
|
||||||
- It uses a clever hack to simulate artificial intelligence.
|
- It uses a clever hack to simulate artificial intelligence.
|
||||||
|
|||||||
@@ -1011,6 +1011,62 @@ cannot be fixed for modern systems as the bug is long gone.
|
|||||||
An alternate version, however, does exist. See the README.md file for details.
|
An alternate version, however, does exist. See the README.md file for details.
|
||||||
|
|
||||||
|
|
||||||
|
### STATUS: INABIAF - please **DO NOT** fix
|
||||||
|
### Source code: [1993/schnitzi/schnitzi.c](1993/schnitzi/schnitzi.c)
|
||||||
|
### Information: [1993/schnitzi/README.md](1993/schnitzi/README.md)
|
||||||
|
|
||||||
|
If the file cannot be opened it will very likely segfault. This should not be
|
||||||
|
fixed except for an exercise to yourself, should you wish to try.
|
||||||
|
|
||||||
|
This program uses `system(3)` so if you provide invalid characters in the
|
||||||
|
question you might cause an error. For instance don't do this:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ./schnitzi schnitzi.info
|
||||||
|
This program answers questions about paragraphs
|
||||||
|
of text posed to it in English. It is written
|
||||||
|
in C. Mark Schnitzius is the author of this
|
||||||
|
program.
|
||||||
|
|
||||||
|
The Loch Ness monster has been captured. Elvis
|
||||||
|
is alive. Hostler was a woman. The NASA moon
|
||||||
|
landings were clearly faked.
|
||||||
|
|
||||||
|
|
||||||
|
? What is foo'?
|
||||||
|
```
|
||||||
|
|
||||||
|
because doing so will result in something like:
|
||||||
|
|
||||||
|
```
|
||||||
|
sh: -c: line 0: unexpected EOF while looking for matching `''
|
||||||
|
sh: -c: line 1: syntax error: unexpected end of file
|
||||||
|
```
|
||||||
|
|
||||||
|
with the program terminating. Other characters will also cause this problem.
|
||||||
|
|
||||||
|
Of course if you do something like:
|
||||||
|
|
||||||
|
```
|
||||||
|
What is 'foo'?
|
||||||
|
```
|
||||||
|
|
||||||
|
it will work fine.
|
||||||
|
|
||||||
|
|
||||||
|
### STATUS: INABIAF - please **DO NOT** fix
|
||||||
|
### Source code: [1993/vanb/vanb.c](1993/vanb/vanb.c)
|
||||||
|
### Information: [1993/vanb/README.md](1993/vanb/README.md)
|
||||||
|
|
||||||
|
No spaces are allowed in the expression.
|
||||||
|
|
||||||
|
The program does no error checking so erroneous expressions will produce
|
||||||
|
spurious results.
|
||||||
|
|
||||||
|
The unary `-` is an operator so decimal `-46` should be entered as `-d46` and
|
||||||
|
not `d-46`.
|
||||||
|
|
||||||
|
|
||||||
# 1994
|
# 1994
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user