PROCISHI - Process Ishi Format Go Files - v3a 1998-12-27 / 2004-10-16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Author: Steve Bailey, 2kyu. West Surrey Go Club, UK SGBailey@iee.org Files (Distributed): PROCISHI.EXE (Place in an applications directory, for example in C:\APPS\GAMES\GO\UTILS, it does not need to be in the command path) PROCISHI.TXT (This documentation file. Line72, soft tab4.) EXAMPLE1.GO A short sample Ishi file. TREES.GO A second sample Ishi file for proving promotion. TREES.TXT A schematic view of the structure of TREES.GO. Files (Required): VBRUN300.DLL (Visual Basic. Place in your WINDOWS\SYSTEM directory) DISCLAIMER I wrote PROCISHI to aid my own study of the game of Go. It is released as freeware 'as seen'. I accept no responsibility for anything the program may do or cause to happen. Please distribute all the files together. ======================================================================= FUNCTION Procishi processes Ishi Format Go files in three ways: a) It renumbers moves b) It promotes variations c) It permits the use of a text editor. Procishi is not optimised for speed. ------ MOVE RENUMBERING Move renumbering comes in three variations: a) Retain existing numbers b) Renumber variations from 1 c) Renumber variations from current move number. Each variation also 'massages' the Ishi format file. I have discovered that 'Ishi format' is not as standardly interpreted as it ought to be. In particular I have found that some programs which I regularly use dislike files generated by the other ones. To that end, the program: a) Converts the firstword of all commands into upper case. b) Converts all coordinate references into lower case. c) Deletes all blank lines. (This may change in later versions as it affects comments.) d) Deletes null comments (COM/ENDCOM with no body). e) Adds 'BOARDSIZE 19' if no boardsize is specified. f) Indents each nest of variations an extra four spaces as the default action. This may be turned off by unchecking 'Indent variations'. g) Converts lines to CRLF termination from either CRLF or LF only. h) It removes all commands 'MARK ALL'. (It does not remove commands such as 'MARK ALL \T@K10' as the default action. This may be turned off by unchecking 'Add 'Mark All''. i) Adds 'MARK ALL' at the end of every variation. Again turned off by unchecking 'Add 'Mark All''. j) Removes any Ctrl-Z at the end of a file. k) Inserts PASS commands where specified. RETAIN NUMBERING "Retain numbers" Basically this just does the massaging listed above. Moves are not renumbered. It alsoresponds to embedded '##pass' comments (but NOT to '##n' comments), see below. RENUMBERING VARIATIONS FROM 1 "Vars from 1" Every time that a new variation starts, it starts from move 1. This is the standard convention used in practically all programs and in diagrams in books. It also responds to embedded '##n' and '##pass' comments (see below). RENUMBERING VARIATIONS FROM CURRENT MOVE NUMBER. "Vars from move#" This is a feature that I added for my own use. When studying a situation, I get frustrated when there is, for example, a diagram with moves 1-8 for which the text is "Instead of 4, White could play 1-7 in diagram 2." Since White 1 in diagram 2 is an alternative to White 4 in diagram 1, I would prefer diagram 2 to be numbered 4-10 and the text to read appropriately. I do not know if all Ishi viewers can handle this, but the one I use can. It also responds to embedded '##n' and '##pass' comments (see below). '##n' COMMENTS If any move has a comment associated with it of the form ##number, then that move is forced to be the specified number. It permits exceptions to the above global renumbering schemes. I find it useful when preparing diagrams for my web pages: (http://www.stocton.org) '##PASS' COMMENTS Any move which has a comment associated with it including the text ##PASS (case independent) will have that move converted into a pass. The comment will be converted to ##PAST. This is a feature I use because Yago does not appear to have the ability to play a 'pass' move. This permits the playing of a stone at an out of the way point and then decreeing that move to really be a pass. (If you require to use both '##n' and '##pass' on one move, ensure that they are on separate lines within the comment.) SCHEMATIC EXAMPLE This example shows the effect the three sorts of renumbering has on the games tree structure. One example of a '##n' comment is included. The example is NOT a sensible initial game tree, although it is provided as EXAMPLE1.GO to permit experiments. Source Retain From 1 From 'N' 1 1 1 1 2 2 2 2 |---1 |---1 |---1 |---2 | 2 | 2 | 2 | 3 |---2 |---2 |---1 |---2 | 3##6 | 3##6 | 6##6 | 6##6 | 4 | 4 | 7 | 7 | ---2 | ---2 | ---1 | ---7 | 3 | 3 | 2 | 8 |---3 |---3 |---1 |---2 | 4 | 4 | 2 | 3 3 3 3 3 4 4 4 4 5##pass 5##past 5##past 5##past 8 8 6 6 9 9 7 7 EXAMPLE1.GO also has absurd spacing, capitalisation, line breaks and file end markers. It is used as a test file. ------ PROMOTING A VARIATION When investigating a go situation, many different situations can be explored with a go editor using its "add variation" feature. At the end of the variation then one path will probably be determined to be the 'correct' sequence. Marking a variation (using the embedded comment '##up') and running promote will exchange the specified variation with its parent tree. Once promoted, the revised file is automatically renumbered with variations numbered from 1. The comment '##up' is altered to '##ok'. If multiple variations are marked, then the promote process may be repeated many times until all '##up's have been dealt with. SCHEMATIC EXAMPLE: Source Promoted Renumbered a a a1 b b b2 |---c |---c |---c1 | d | d | d2 |---e##up |---l |---l1 | f | m | m2 | g | n | n3 | ----h | |---o | |---o1 | i | | p | | p2 |---j | q | q4 | k | r | r5 l |---j |---j1 m | k | k2 n e##ok e3 |---o f f4 | p g g5 q ----h ----h1 r i i2 ------ BACKUPS Each time a file is processed sucessfully, the original file is replaced by the processed version. The original file is copied to your temporary directory with the same name but the extension changed to the next available number (000-999). If you do lots of processing, you will rapidly fill your TEMP directory up. Before deleting the files, check the processed file is satisfactory. The temporary directory is defined by environment variable TEMP. Usually in your AUTOEXEC.BAT file there will be a line such as: SET TEMP=C:\WINDOWS\TEMP If TEMP cannot be found then the root directory of the current drive is used for backups. RESTORING FILES Processing using the 'Restore' option brings up two file selectors. The first initialises to the last backup file and is used to select the file to copy. The second initialises to the last file processed and is the file replaced (or created). ======================================================================= OPERATION Use your Ishi compatible editor to add flags in comments as required. These will be of the form ##UP, ##PASS (both case independent) and ##5 or ##123. They may be embedded in a comment along with real comments. Also remove any ##OK flags no longer required. If this leaves an empty comment it will be removed. Save the file. Open the application. Select the mode: Retain numbers Vars from 1 Vars from N Restore Promote Enable / disable 'Indent variations' as required. (Not relevant in Restore mode.) Enable / disable 'Add 'Mark All'' as required. (Not relevant in Restore mode.) Click on 'Process'. Select the relevant file(s). The Process button greys during processing. Cancelling the selection cancels the process. Once processing is complete, the Process text will list the file sucessfully processed (or if it failed will revert to the previous message). The Backup text will list the name of the copy of the original file. The bottom line of text is a status field, it will report what is happening - Select File, Processing, Completed, Cancelled etc. The 'Re-' button may be used to reprocess the file last selected for processing. Double clicking on the status text clears the Process, Backup and Status texts. It also displays a contact dialog box. Once all actions have been performed, click on 'Exit'. CONFIGURATION There are four command line parameters (case and order independent). /debug Provides diagnostic information in files in the TEMP directory. /noiv Unchecks 'Indent variables'. /noma Unchecks 'Add 'Mark All''. /pfe When this parameter is absent, the text editor used is "notepad", when present, the text editor used is "pfe". PFE is obtainable as freeware from http://www.lancs.ac.uk/people/cpaap/pfe/ TECHNOSPEAK The program is written in Visual Basic v3 under Windows for Workgroups v3.11. It has been tested with input files from an old version of Many Faces of Go, YAGO and the Go Seigen files from T.M.Hall (believed to have been created with GoScribe). Its output has been used as input to the old version of Many Faces and to YAGO. Note it has _not_ been tested under Windows 95. The program creates some *.TMP files in your TEMP directory - to aid debug and as intermediate files. They will normally be deleted when the program is closed. (To retain them, launch the program with "/debug" as a command line parameter.) BUGS AND SUGGESTIONS If you find a *.GO file which causes the program to fail, or if you wish to suggest improvements, please email me with the details. I may (or may not) do something about it. === sgb