\comment{\%}{0}{}{Help Module -- procedures to print out help information for CromChex
}
\codebegin{0}{}\codeend
\codebegin{0}{wo = window\_obj}\codeend
\codebegin{0}{}\codeend
\codebegin{0}{help\_general = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out available commands onto the help area
specified by help. Signals not\_possible if the help area
is too small.
}
\codebegin{4}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^Available commands are: MOVE, ADVISE, TIME, SAVE, EXIT, QUIT, NEW, LOAD, DIFFICULTY, UNDO, HELP \n \nFor help about a specific command, type HELP <command>^'')}\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long: wo\$display(help, ``\verb^M A T S E Q N L D H^'')}\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{0}{{\bf end} help\_general}\codeend
\codebegin{0}{}\codeend
\codebegin{0}{help\_move = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for MOVE onto the help area
specified by help. Signals not\_possible if the help area
is too small.
}
\codebegin{4}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^MOVE <coord> <dir> [<dir> ...] \n \nMove piece at coord in the indicated dir(s). A coord is a letter followed by a character, e.g. a3. A dir is either L or R. Use multiple dirs to achieve multiple jumps.^'') }\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long: }\codeend
\codebegin{8}{wo\$display(help, ``\verb^MOVE <coord> <dir> [<dir> ...]^'') }\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{4}{{\bf end} help\_move}\codeend
\codebegin{0}{}\codeend
\codebegin{0}{help\_advise = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for ADVISE onto the help
area specified by help. Signals not\_possible if the help
area is too small.
}
\codebegin{4}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^ADVISE \n \nPrintss in the help area the best next move for the user according to the computer's move selection heuristic. Time continues to run while the computer computes the move.^'')}\codeend
\codebegin{6}{{\bf except} {\bf when} too\_long:}\codeend
\codebegin{10}{wo\$display(help, ``\verb^ADVISE^'')}\codeend
\codebegin{11}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{10}{{\bf end}}\codeend
\codebegin{4}{{\bf end} help\_advise}\codeend
\codebegin{0}{}\codeend
\codebegin{0}{help\_time = {\bf proc} (help: window\_obj) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for TIME onto the help area
specified by ho. Signals not\_possible if the help area
is too small.
}
\codebegin{4}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^TIME <p> <amt> \n \nAdds indicated amount of time to designated player. The <p> is one of USER or COMPUTER. The amount of time has the form pmm:ss when p is one of + or -, and mm, and ss are minutes and seconds respectively.^'')}\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long:}\codeend
\codebegin{8}{wo\$display(help, ``\verb^TIME <p> <amt> \n \n<p> is player \n<amt> is +/-mm:ss^'') }\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{4}{{\bf end} help\_time}\codeend
\codebegin{0}{}\codeend
\codebegin{0}{help\_save = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for SAVE onto the help area
specified by help. Signals not\_possible if the help area
is too small.
}
\codebegin{4}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^SAVE <filename> \n \nSave the current game into indicated file. The game continues after being saved.^'')}\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long:}\codeend
\codebegin{8}{wo\$display(help, ``\verb^SAVE <fname>^'')}\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{4}{{\bf end} help\_save}\codeend
\codebegin{0}{}\codeend
\codebegin{0}{help\_exit = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for EXIT onto the help area
specified by help. Signals not\_possible if the help area
is too small.
}
\codebegin{0}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^EXIT \n \nTerminate current game and exit program.^'')}\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long:}\codeend
\codebegin{8}{wo\$display(help, ``\verb^EXIT^'')}\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{4}{{\bf end} help\_exit}\codeend
\codebegin{0}{}\codeend
\codebegin{0}{help\_quit = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for QUIT onto the help area
specified by help. Signals not\_possible if the help area
is too small.
}
\codebegin{0}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^QUIT \n \nTerminate current game and exit program.^'')}\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long:}\codeend
\codebegin{8}{wo\$display(help, ``\verb^QUIT^'')}\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{4}{{\bf end} help\_quit}\codeend
\codebegin{4}{}\codeend
\codebegin{0}{help\_new = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for NEW onto the help area
specified by ho. 
}
\codebegin{4}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^NEW \n \nTerminate current game and start a new one.^'')}\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long:}\codeend
\codebegin{8}{wo\$display(help, ``\verb^NEW^'')}\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{4}{{\bf end} help\_new}\codeend
\codebegin{4}{}\codeend
\codebegin{0}{help\_load = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for LOAD onto the help area
specified by help. Signals not\_possible if the help area 
is too small.
}
\codebegin{4}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^LOAD <filename> \n \nReplace the current game with the one saved in the file. First looks in the file named <filename>, then looks in <filename>.brd.^'')}\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long: }\codeend
\codebegin{8}{wo\$display(help, ``\verb^LOAD <f>^'')}\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{4}{{\bf end} help\_load}\codeend
\codebegin{0}{}\codeend
\codebegin{0}{help\_difficulty = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for DIFFICULTY onto the help
area specified by help. Signals not\_possible if the help
area is too small.
}
\codebegin{4}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^DIFFICULTY n \n \nSet difficulty level to n (1<=n<=10). The higher n, the more difficult (and the longer the computer takes to make its move). It is not recommended to exceed level 4.^'')}\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long:}\codeend
\codebegin{8}{wo\$display(help, ``\verb^DIFFICULTY n^'')}\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{4}{{\bf end} help\_difficulty}\codeend
\codebegin{0}{}\codeend
\codebegin{0}{help\_undo = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for UNDO onto the help area
specified by help. Signals not\_possible if the help area
is too small.
}
\codebegin{4}{}\codeend
\codebegin{4}{wo\$display(help,``\verb^UNDO [n] \n \nUndoes the last n moves of the game, for n<=10. If no n is specified, it defaults to n=1. A move consists of a user's move and a computer's move.^'')}\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long: }\codeend
\codebegin{8}{wo\$display(help,``\verb^UNDO [n]^'')}\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{4}{}\codeend
\codebegin{4}{{\bf end} help\_undo}\codeend
\codebegin{0}{}\codeend
\codebegin{0}{help\_help = {\bf proc} (help: wo) {\bf signals}(not\_possible)}\codeend
\comment{\%}{4}{modifies:}{ help
}
\comment{\%}{4}{}{}
\comment{\%}{4}{effects:}{ Prints out help information for HELP onto the help area
specified by help. Signals not\_possible if the help area
is too small.
}
\codebegin{4}{}\codeend
\codebegin{4}{wo\$display(help, ``\verb^HELP [<command>] \n \nPrints help in the help area. Help by itself lists the command names. Help followed by a command name gives more detailed help on a specific command.^'')}\codeend
\codebegin{5}{{\bf except} {\bf when} too\_long:}\codeend
\codebegin{8}{wo\$display(help, ``\verb^HELP [<c>]^'')}\codeend
\codebegin{9}{{\bf except} {\bf when} too\_long: {\bf signal} not\_possible {\bf end}}\codeend
\codebegin{8}{{\bf end}}\codeend
\codebegin{4}{{\bf end} help\_help}\codeend
