Add to / fix formatting in 1991/ant/README.md

In the judges' comments add some humour.

Add a try section.

Note that a file is needed for the program to do anything (that is a
file that exists) - not specifying an arg will exit without doing
anything at all.

Explain how to enter form-feed as this is important.

Fix formatting.
This commit is contained in:
Cody Boone Ferguson committed 2023-03-19 06:05:08 -07:00
1 parent 94ece1f48d
commit 9c2c19582c
1 file changed
+89 -65
+89 -65
View File
@@ -10,93 +10,117 @@
make all make all
### To run ## To run:
./ant some_file
NOTE: the file must already exist and not specifying any arg will make the
program exit without doing anything.
## Try:
cp README.md hill cp README.md hill
./ant hill ./ant hill
## Judges' comments ## Judges' comments:
The author was kind enough to supply a list of references below, The author was kind enough to supply a list of references below,
in case you are still confused after read the source! :-) in case you are still confused after read the source! :-)
## Author's comments BTW: you've most likely heard the joke that if you want a pseudo-random string
of characters you can put a user unfamiliar with vi(m) in a vi(m) session (in
insert mode) and ask them to exit. Well in this case you're likely to have this
problem if you ARE a vi(m) user! :-) ... especially if you don't read the
information below. This means if you're reading this in vi(m) you'll have to
exit this like in normal vi(m) and then exit `./ant` differently.
Ant's Editor vIOCCC91 NOTE: to enter form feed you should be able to hit `ctrl-L`. This will allow you
to exit insert mode rather than ESC like in normal vi(m). See the author's
commands section for other commands.
Text files consists of lines of printable text or tab characters. ## Author's comments:
A line can be of arbitrary length and is delimited by either a
newline or the end of file. Carriage return is mapped to newline
on input and ignored on output. Tab stops are every eight columns.
Non-printable characters may have unpredictable results depending
on the implementation of CURSES.
COMMANDS Ant's Editor vIOCCC91
h j k l left, down, up, right cursor movement
H J K L word left, page down, page up, word right
[ ] beginning and end of line
t b top and bottom of file
i enter insert mode, formfeed to quit
x delete character under the cursor
W write buffer to file
R refresh the screen
Q quit
EXIT STATUS Text files consists of lines of printable text or tab characters.
0 success A line can be of arbitrary length and is delimited by either a
2 missing edit filename newline or the end of file. Carriage return is mapped to newline
on input and ignored on output. Tab stops are every eight columns.
Non-printable characters may have unpredictable results depending
on the implementation of CURSES.
The BUF size should be set at compile time to 32767. This value ### COMMANDS:
was used because the Sozobon C compiler for the Atari ST has 16
bit ints and a limit on the size of arrays & structures of 32k.
Also the WatCom C compiler for the PC also has 16 bits ints. On
machines that have 32 bit ints (most unix boxes), a larger value
for BUF could be used.
It is recommend that compact memory model be used on PC class h j k l left, down, up, right cursor movement
machines. Small memory model may work too provided BUF is not H J K L word left, page down, page up, word right
too large. [ ] beginning and end of line
t b top and bottom of file
i enter insert mode, formfeed to quit
x delete character under the cursor
W write buffer to file
R refresh the screen
Q quit
The character constants '\b', '\f', '\n', '\r', '\t' are used ### EXIT STATUS:
in order to provide more portable code, since the compiler should
handle the translation of them into the native character set.
Note that '\f' (formfeed) was used to exit insert mode because
K&R C had no escape constant for the escape-key.
My goals for this project were to learn and experiment with the 0 success
Buffer Gap Scheme [Fin80][net90], write a useful and *portable* 2 missing edit filename
programme, and meet the requirements of the IOCCC. I initially
planned to have a mini CURSES built-in like the IOCCC Tetris entry
from a previous year, however this was not as portable as using a
CURSES library with TERMINFO/TERMCAP support.
I plan to post followups such as unobfuscated versions and bugs
fixes to comp.editors. Reposts of the editor.101, gap.doc, and
editor.102 can be found in the same group every so often.
This entry will display a file with long lines, but has trouble ### ABOUT THIS ENTRY:
scrolling the screen with long lines. Paging up and down should
work correctly, however.
REFERENCES The BUF size should be set at compile time to 32767. This value
[Fin80] Craig A. Finseth, "Theory and Practice of Text Editors or was used because the Sozobon C compiler for the Atari ST has 16
A Cookbook For An EMACS", TM-165, MIT Lab. for Computer bit ints and a limit on the size of arrays & structures of 32k.
Science Also the WatCom C compiler for the PC also has 16 bits ints. On
machines that have 32 bit ints (most unix boxes), a larger value
for BUF could be used.
[KeP81] Kernighan & Plauger, "Software Tools in Pascal", It is recommend that compact memory model be used on PC class
Addison-Wesley, 81, chapter 6 machines. Small memory model may work too provided BUF is not
too large.
[Mil86] Eugene W. Myers & Webb Miller, "Row-replacement Algorithms The character constants '\b', '\f', '\n', '\r', '\t' are used
for Screen Editors", TR 86-19, Dept. of Computer Science, in order to provide more portable code, since the compiler should
U. of Arizona handle the translation of them into the native character set.
Note that '\f' (formfeed) was used to exit insert mode because
K&R C had no escape constant for the escape-key.
[MyM86] Eugene W. Myers & Webb Miller, "A simple row-replacement My goals for this project were to learn and experiment with the
method", TR 86-28, Dept. of Computer Science, U. of Arizona Buffer Gap Scheme [Fin80][net90], write a useful and *portable*
programme, and meet the requirements of the IOCCC. I initially
planned to have a mini CURSES built-in like the IOCCC Tetris entry
from a previous year, however this was not as portable as using a
CURSES library with TERMINFO/TERMCAP support.
[Mil87] Webb Miller, "A Software Tools Sampler", Prentice Hall, 87 I plan to post followups such as unobfuscated versions and bugs
ISBN 0-13-822305-X, chapter 5 fixes to comp.editors. Reposts of the editor.101, gap.doc, and
editor.102 can be found in the same group every so often.
[net90] "Editor 101/102" articles from comp.editors This entry will display a file with long lines, but has trouble
scrolling the screen with long lines. Paging up and down should
work correctly, however.
### REFERENCES:
[Fin80] Craig A. Finseth, "Theory and Practice of Text Editors or
A Cookbook For An EMACS", TM-165, MIT Lab. for Computer
Science
[KeP81] Kernighan & Plauger, "Software Tools in Pascal",
Addison-Wesley, 81, chapter 6
[Mil86] Eugene W. Myers & Webb Miller, "Row-replacement Algorithms
for Screen Editors", TR 86-19, Dept. of Computer Science,
U. of Arizona
[MyM86] Eugene W. Myers & Webb Miller, "A simple row-replacement
method", TR 86-28, Dept. of Computer Science, U. of Arizona
[Mil87] Webb Miller, "A Software Tools Sampler", Prentice Hall, 87
ISBN 0-13-822305-X, chapter 5
[net90] "Editor 101/102" articles from comp.editors
Copyright (c) 1991, Landon Curt Noll & Larry Bassel. Copyright (c) 1991, Landon Curt Noll & Larry Bassel.
All Rights Reserved. Permission for personal, educational or non-profit use is All Rights Reserved. Permission for personal, educational or non-profit use is