home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l360 / 3.ddi / APPC.@EM / BATTLE.WKS < prev    next >
Encoding:
Text File  |  1991-04-08  |  7.4 KB  |  140 lines

  1.       *******************************************************************
  2.       *                                                                 *
  3.       *                                                                 *
  4.       *                  (C) Micro Focus Ltd. 1990                      *
  5.       *                                                                 *
  6.       *                         BATTLEL.WKS                             *
  7.       *                                                                 *
  8.       *      COBOL Advanced Program to Program (APPC) Demonstration     *
  9.       *                                                                 *
  10.       *      working-storage copy file                                  *
  11.       *                                                                 *
  12.       *******************************************************************
  13.  
  14.       *-----------------------------------------------------------------
  15.       *    Grid-Table - contains locations of ships
  16.       *-----------------------------------------------------------------
  17.        01 Grid-Table redefines Battle-Grid.
  18.           03 filler                        Occurs 9.
  19.               05 Grid-Array                Pic X Occurs 13.
  20.  
  21.       *-----------------------------------------------------------------
  22.       *    Grid-Att-Table - contains opponent damage locations as
  23.       *                     different attributes eg hit=red, miss=cyan
  24.       *-----------------------------------------------------------------
  25.        01 Grid-Att-Table.
  26.           03 filler                        Occurs 9.
  27.               05 Grid-Att-Array            Pic 9(2) Occurs 13.
  28.  
  29.       *-----------------------------------------------------------------
  30.       *    Grid-Coordinates - coordinates in form eg. 'G9'
  31.       *-----------------------------------------------------------------
  32.        01 Grid-Coordinates.
  33.           03 Grid-1                        Pic X.
  34.           03 Grid-1-Asc redefines Grid-1   Pic 9(2) Comp-X.
  35.           03 Grid-2                        Pic X.
  36.  
  37.       *-----------------------------------------------------------------
  38.       *    Grid-Asc - ascii value of Grid-Chr used for decoding
  39.       *               coordinate
  40.       *-----------------------------------------------------------------
  41.        01 Grid-Chr                         Pic X.
  42.        01 Grid-Asc redefines Grid-Chr      Pic 9(2) Comp-X.
  43.  
  44.       *-----------------------------------------------------------------
  45.       *    Grid-Row,Grid-Col - decoded x and y offsets into Grid-Table
  46.       *-----------------------------------------------------------------
  47.        01 Grid-Pos.
  48.           03 Grid-Row                      Pic 9(2) Comp-X.
  49.           03 Grid-Col                      Pic 9(2) Comp-X.
  50.  
  51.       *-----------------------------------------------------------------
  52.       *    Temp-Row,Temp-Col - temporary data used by various routines
  53.       *-----------------------------------------------------------------
  54.        01 Temp-Row                         Pic 9(2) Comp-X.
  55.        01 Temp-Col                         Pic 9(2) Comp-X.
  56.  
  57.       *-----------------------------------------------------------------
  58.       *    Max-Row,Max-Col - upper limits of grid
  59.       *-----------------------------------------------------------------
  60.        01 Max-Row                          Pic 9(2) Comp-X Value 9.
  61.        01 Max-Col                          Pic 9(2) Comp-X Value 13.
  62.  
  63.       *-----------------------------------------------------------------
  64.       *    Sunk-Ship-Locations - grid positions of a sunk ship to be
  65.       *                          provided to opponent
  66.       *-----------------------------------------------------------------
  67.        01 Sunk-Ship-Locations.
  68.           03 Sunk-Ship                     Occurs 4.
  69.              05 Sunk-Ship-Row              Pic 9(2) Comp-X.
  70.              05 Sunk-Ship-Col              Pic 9(2) Comp-X.
  71.       *-----------------------------------------------------------------
  72.       *    Ship-Sector - sub-division of a ship across several locations
  73.       *-----------------------------------------------------------------
  74.        01  Ship-Sector                     Pic 9(2) Comp-X.
  75.  
  76.       *-----------------------------------------------------------------
  77.       *    Key-Char - contains a keyboard response character
  78.       *-----------------------------------------------------------------
  79.        01  Key-Char                        Pic X.
  80.  
  81.       *-----------------------------------------------------------------
  82.       *    Damage-Msg - contains damage report to be sent/received
  83.       *                 to/from opponent eg 'HIT','MISS''SINK' etc.
  84.       *-----------------------------------------------------------------
  85.        01  Damage-Msg                       Pic X(4).
  86.  
  87.       *-----------------------------------------------------------------
  88.       *    Sink-Coords - temporary store for holding sunk ship locations
  89.       *-----------------------------------------------------------------
  90.        01  Sink-Coords                      Pic X(8).
  91.  
  92.       *-----------------------------------------------------------------
  93.       *    Target-Object - contains character found at grid location
  94.       *-----------------------------------------------------------------
  95.        01  Target-Object                    Pic X.
  96.  
  97.       *-----------------------------------------------------------------
  98.       *    operation codes used to interface to communication module
  99.       *-----------------------------------------------------------------
  100.        78 Connect-Code                     Value 1.
  101.        78 Disconnect-Code                  Value 2.
  102.        78 Send-Coords-Code                 Value 3.
  103.        78 Receive-Coords-Code              Value 4.
  104.        78 Send-Report-Code                 Value 5.
  105.        78 Receive-Report-Code              Value 6.
  106.  
  107.       *-----------------------------------------------------------------
  108.       *    Screen-Msgs - Different messages that may appear on screen
  109.       *-----------------------------------------------------------------
  110.        01  Screen-Msgs.
  111.            03 Screen-Msg-1                 Pic X(25).
  112.            03 Screen-Msg-2                 Pic X(20).
  113.            03 Screen-Msg-3                 Pic X(30).
  114.            03 Screen-Msg-4                 Pic X(20).
  115.  
  116.  
  117.       *-----------------------------------------------------------------
  118.       *    Flags - defines various conditions
  119.       *-----------------------------------------------------------------
  120.        01 Flags.
  121.           03 filler                        Pic 9(2) Comp Value 0.
  122.              88 Win-Game                   Value 1.
  123.              88 Lose-Game                  Value 2.
  124.              88 Game-Over                  Value 1,2.
  125.           03 filler                        Pic 9(2) Comp.
  126.              88 Ship-Not-Sunk              Value 0.
  127.              88 Ship-Sunk                  Value 1.
  128.           03 filler                        Pic 9(2) Comp Value 0.
  129.              88 End-Of-Ship                Value 1.
  130.              88 Not-End-Of-Ship            Value 0.
  131.  
  132.  
  133.       *-----------------------------------------------------------------
  134.       *    Battle-Buffer
  135.       *    Battle-Op-Code
  136.       *        - are call parameters to communications module
  137.       *-----------------------------------------------------------------
  138.        01  Battle-Buffer                   Pic x(12).
  139.        01  Battle-Op-Code                  Pic 9(2) Comp-X.
  140.