The following Turbo Pascal Units and Programs were made for task Wires: UNIT USES ---- ---- Cables Measure Cables; Generate, Judging Generate Cables Judging PROGRAM USES ------- ---- Wires Cables, Judging, Environ Wires-T Cables, Judging, Environ GenCable Cables, Generate UNIT/PROG DESCRIPTION --------- ----------- Cables Provides constants and types for Cables Judging Provides types and routines for "direct" two-computer judging Generate Provides routines for generating Cables Measure Provides routines for measuring Cables Wires Program to reconstruct Cables (several methods) Wires-t Program to test reconstruction programs (using two computers) GenCable Program to generate Cables Wires.pas can be compiled to produce a number slightly different programs. The two main versions are a single-computer version with built-in tester (const Test = true;) and a dual-computer version without built-in tester (const Test = false;). The dual-computer version sends its commands to standard output and reads results from standard input. The version with built-in tester handles all measurements locally. To get a program that solves the competition task you need to set: const Test = false; SingleCable = true;. The single-computer version works interactively. The dual-computer version determines its reconstruction method as follows: if a command-line parameter is present then that is interpreted as the number of the method; otherwise, if the file progname.cfg is present, then it is opened as a text file and the method number is read (N.B. progname is the actual name of the program, usually that will be `wires', but the program can be renamed; this is useful if you have other solutions around as well.); otherwise, the constant DefaultMethod determines the method. The methods have been numbered as follows: 1 Ask the user to provide the commands 2 W1 (per wire, do linear search to find switch, reset switch after probe) 3 W2 (initially probe wire and change switches until probe differs) 4 W3 (slightly optimized W2) 5 W4 (like W2 but continues cyclicly through switches) 6 W5 (slightly optimized W4) 7 W6 (like W2 but does up-down sweep through switches, optimized) 8 S1 (per switch, find all wires) 9 S2 (like S1, skip wires that are already determined) 10 S3 (like S2, stop when all wires determined) 11 BN(true) (binary notation, LSB first) 12 BN(false) (binary notation, MSB first) 13 BS(false, false) (binary search, not minimized, not suppressed) 14 BS(false, true) (binary search, not minimized, suppressed) 15 BS(true, false) (binary search, minimized, not suppressed) 16 BS(true, true) (binary search, minimized, suppressed) Program Wires produces two text files: progname.out and logfilec.txt . The first file summarizes the settings; the second file provides a log of the conversations. Program Wires-T is a tester program for the dual-computer version of Wires. For this you need two computers whose serial ports have been connected by a null-modem cable. Use the DOS command MODE to set up the serial ports for matching communication parameters (baud rate, etc.) The computer running Wires should have its console changed to the serial port with the cable (use the DOS command CTTY). The computer running Wires-T should have the cable on COM2 (this can be changed to COM1 in Unit Judging). Program Wires-T can be started in two ways: with and without command-line parameter. When started without command-line parameter it is assumed that Wires already runs on the other computer (e.g. when you activated it through some terminal emulator). When started with command-line parameter, Wires-T will send control-C to abort any program running on the other computer and then it will start Wires with the same command-line parameter (which indicates the reconstruction method to be used). Wires-T is an interactive program (like the single-computer version of Wires). It produces the text file logfilee.txt. It should be noted that dual-computer testing is tricky and may require careful fine tuning. The Unit Judging has some variables to do such tuning. These variables are set in Wires-T. It all depends on your BIOS and DOS versions. It should also be noted that this program was not used for evaluation at IOI'95. At IOI'95 we have used AE, the Automatic Evaluator, which uses a special unit, MyReacti, to evaluate task Wires. This unit is available with the AE software. It works according to the same principles. Program GenCable can be used to generate files with cable descriptions. Tom Verhoeff Scientific Committee IOI'95