Haiku is a Japanese form of poetry that is comprised of 3 non-rhyming lines with 5, 7, and 5 syllables. It is made up of a condition or situation element, separated by a 'cutting word’ from an element of sudden perception. In English the cutting word is best rendered by emphatic punctuation such as a dash or exclamation mark. For instance:
Spring air -
woven moon
and plum scent.
Further information about haiku can be found on the Internet, or in the Penguin Classic ‘On Love and Barley – Haiku of Basho’.
This haiku generator is a windows application built with Judith’s IDE, win32lib, and my enhanced EDS database interface. It has been tested on Windows 98 and Windows XP. Many thanks to Judith and the win32lib team for their efforts which have simplified the application development enormously.
The files in this zip file are:
- Hiddenhaiku.exe – which is a shrouded and bound version of haiku.exw – and therefore needs no include files.
This program uses an EDS database of individual lines to generate new haiku under your control, and display them in a window application. These lines may be saved to a file for later printing, saved to the database as a complete verse, or treasured for a few moments then dismissed (very Zen). You can enter new individual lines or haiku directly, and output all haiku in the database to a file.
The window opens by default displaying a random haiku from the default database (see below). There is only the one window, although you may also get error message boxes.

Clicking the ‘Next line(s)’ button will display the first record in the Line1 table, the first record in the Line2 table, and the first record in the Line2 table. Clicking the ‘Next line(s)’ button again will get the next record in Line1 table etc. However if the ‘Hold line’ checkbox is ticked that particular line will not change and you have stared to generate your new haiku by mixing it with other existing lines. Ticking the ‘Random next’ checkbox will select new lines at random from the database (apart from those with ticks in the ‘Hold line’ checkbox).
Similarly clicking the ‘Next haiku’ button will select the next or random choice haiku from the database depending on whether or not the ‘Random next’ checkbox is ticked. Clicking the ‘Next haiku’ button overrides any ‘held lines’, but if you hold one or two lines of the haiku and click ‘Next line(s)’, the unheld line(s) will change, again generating new haiku.
You may modify or replace any line with new text. If you also tick the ‘Hold line’ checkbox(es) you may save the held lines back to the database.
If you click the ‘Save haiku’ button, all three lines are saved to the database as a haiku, regardless of any ticked checkbox(es).
So if you want to add all 3 lines lines and the equivalent haiku to the database - modify the lines, tick all the ‘Hold line(s)’ checkboxes, and click ‘Save held line(s)’. The checkboxes will be automatically ‘unticked’ but you can then still save the 3 lines again as a haiku by clicking ‘Save haiku’.
Clicking ‘Output lines’ will write the three displayed lines to a text file (they do not need to be saved in the database). You can repeat this process as often as you wish. The text file can be printed once the application has ended, but the file is overwritten each time the application is started.
Similarly clicking ‘Output haiku’ will write all the saved haiku in the database to a text file.
- The text file, defaults.txt, contains the file name of the haiku database loaded when the windows application is started, plus the names of the files which will hold the output of lines or haiku. You may change these file names to suit yourself. Please remember that you should start a new line after the third entry, and the file names should not be enclosed in quotes. If the database and files are not found, you will be prompted to select a database, and the output files will be given default names.
- The EDS database, haiku.edb, contains 20 sets of lines in tables Line1, Line2, and Line3, plus the same 20 sets of lines in threes as 20 haiku in table Haiku. All the haiku were written by Basho. There is no requirement for the table order or numbers of lines to match the haiku entries, although those in haiku.edb happen to do so because of the way they have been input.
- The EDS database, empty.edb, is ready for you to create your own database of lines and haiku from scratch. I suggest you rename it first.
- Haiku.exw is the source program. You can run it directly as long as win32lib.ew, idb.e, and database3.e are in your include files. These last two may be found in the Recent User Contributions as an ‘Enhanced Interface to EDS’ dated February 26 2003, together with a GUI database editor (in case you wish to edit or inspect a haiku database).
DISCLAIMER
This program is distributed in the hope that it will be useful, but without any warranty;
without even the implied warranty of merchantability or fitness for a particular purpose.
I do not accept responsibility for any effects, adverse or otherwise, that this code may
have on you, your computer, your data, and anything else that you can think of. Use it at your own risk.
Have fun,
A.C.Harper
December 2003