The DPjudge Adjudication Algorithm

    Steps 1 and 2. Mark Invalid Orders

  1. Mark All Invalid Convoy Orders
    • For all convoying armies:
      • If trying to convoy through a non-existent fleet, either change the army's order to HOLD or mark the army "no convoy" (the decision as to which should be done is based on a game option).
      • Otherwise, if trying to convoy through a fleet that did not order a matching convoy order, mark the army "no convoy."
      • Otherwise, include this army in a "convoying armies list."
    • For all fleets issuing convoy orders:
      • If the army being convoyed does not exist, either change the fleet's order to HOLD or mark the fleet "void" (the decision as to which should be done is based on a game option).
      • Otherwise, if the army being convoyed did not issue the matching order, mark the fleet "void."
  2. Mark All Invalid Support Orders
    • For all units issuing support orders:
      • If the unit being supported does not exist, either change the supporting unit's order to HOLD or mark it "void" (the decision as to which should be done is based on a game option)
      • Otherwise, if the unit being supported did not issue the matching order, mark the supporting unit "void."
      • Otherwise:
        1. Increment the "support count" of the supported unit.
        2. If the supported unit is attacking a position that is occupied by a unit owned by the same power that owns the supporting unit, add the supporting unit to the supported unit's "no help list."

    Step 3. Calculate Initial Combat Strengths

  3. Cut All Supports Made by Non-Convoyed Attacks
    • For all non-convoyed move orders:
      • Execute the cutSupport procedure (found below).
    • For every space on the board:
      • Create a "combat list" containing all units that are attempting to either move to or remain in that space.

    Steps 4 and 5. Determine Convoy Success or Failure

  4. Mark Support Cuts Made by Convoyed Armies and Mark Endangered Convoys
    • For every army in the "convoying armies list":
      • Execute the checkDisruptions procedure (found below)
      • If the army is not marked, execute the cutSupport procedure for that army, and add the army to the "convoy succeeded list."
      • Otherwise (if the army is marked "convoy endangered"), change the army's mark to "convoy under attack."
    • If the "convoy succeeded list" grew during this step, then repeat this step.
  5. Mark Convoy Disruptions And Support Cuts Made by Successful Convoys
    • For every army in the "convoying armies list":
      1. Execute the checkDisruptions procedure
      2. If the army is marked "convoy endangered," change its mark to "no convoy."
      3. Otherwise, if the army is marked "convoy under attack,"
        1. Remove the army's mark.
        2. Execute the cutSupport procedure for the army.
        3. Add the army to the "convoy succeeded list."
    • If the "convoy succeeded list" grew during this step, then return to step 4.

    Steps 6 through 9. Determine Bounces and Further Support Cuts

  6. Mark Bounces Caused by Inability to Swap Places
    • For all moving units that are not convoying and are not marked:
      • If the space to which the unit is moving is occupied by a unit that is
        1. not marked, and
        2. attempting to swap places with the first unit, and
        3. not being convoyed,
        then call this other unit the "swapper."
      • If there is a "swapper," then
        1. If the "support count" for the unit is not greater than the "support count" for the swapper, execute the bounce procedure for the unit.
        2. If the "support count" for the "swapper" is not greater than the "support count" for the unit, execute the bounce procedure for the "swapper."
    • If any unit was marked "bounce" during this step, repeat this step.
  7. Mark Bounces Suffered by Understrength Attackers
    • For all spaces on the board:
      • For every unit in the "combat list" for that space:
        • If the unit meets all of the following requirements:
          1. does not have a greater "support count" than every other unit in the space's "combat list,"
          2. is attempting a move order, and
          3. is not marked,
          then execute the bounce procedure (described below) for that unit.
    • If any unit was marked "bounce" during this step, return to step 6.
  8. Mark Bounces Caused by Inability to Self-Dislodge
    • For each space on the board:
      • If the "combat list" for that space includes one unit whose "support count" is greater than that of every other unit in the "combat list" for the space, and if
        1. the unit is not marked, and
        2. the unit is attempting a move order,
        then call the unit occupying the space to which the move is being made the "victim."
      • If there is a "victim," but the "victim" was issued a move order and is not marked, then there is no "victim."
      • If there is still a "victim," but if the "victim" is owned by the same power that owns the moving unit, there is no "victim."
      • If there is still a "victim", then subtract the number of units listed in the moving unit's "no help" list from its "support count." If this result is no longer larger than the "support count" for all other units in the "combat list" for the space, execute the bounce procedure for the moving unit.
    • If any unit was marked "bounce" during this step, return to step 6.
  9. Mark Supports Cut By Dislodgements
    • For every moving unit that is not marked:
      • Execute the cutSupport procedure.
    • If any unit was marked "cut" during this step, return to step 6.

    Step 10. Move Units That Did Not Bounce

  10. Mark Dislodged Units and Make All Successful Moves
    • For every moving unit that is not marked:
      • If the unit is moving to a space occupied by another unit, and if that other unit is either marked or not moving, then
        1. Mark the other unit "dislodged."
        2. If the dislodged unit had attempted a non-convoyed move into the space from which its attacker came, and if the attacker also was not convoyed, then remove the dislodged unit from the "combat list" for the space from which the attacker came.
        3. Create the "possible retreats" list for the dislodged unit by listing all spaces on the board to which the unit could move without convoying, but do not list the space from which the dislodged unit's attacker came, nor any space with a "combat list."
      • Execute the unbounce procedure for the space being vacated by the moving unit.
      • Move the unit to its destination space.

    Procedures Used By the Above Steps

    cutSupport, executed for a particular moving unit
    If the move is to a location occupied by a supporting unit that fits all of the following criteria:
    1. is not already marked "cut" or "void,"
    2. is not owned by the same power as the moving unit,
    3. if (and only if) the moving unit is a convoyed army, the supporting unit is not offering support for or against any convoying fleet (whose order is not marked "void"), and
    4. either we are executing Step 9 of the main algorithm or the supporting unit is not offering support for a move into the space from which the moving unit originated.
    then do the following:
    1. Mark the supporting unit "cut"
    2. Decrement the number of supports that the supported unit has
    3. Remove the supporting unit from the supported unit's "no help list" (if it appears there).

    checkDisruptions, executed for a particular convoying army
    • For every fleet in the army's convoy path:
      • If the "combat list" for the space occupied by the fleet contains a single unit with a higher support count than all others, and if that single unit is not owned by the same power that owns the convoying fleet, then mark the convoying army as "convoy endangered."
      • (If the RULE BELEAGUERED_DISRUPTS is in use, an army is also marked "convoy engangered" if the combat list for the space occupied by the fleet has more than one unit tied with an equal greatest support count, and if at least one of these units is not owned by the same power that owns the convoying fleet, and if the convoying fleet is not one of these units.)

    bounce, executed for a particular moving unit
    • Mark the unit "bounce."
    • Add the unit, with a "support count" of 0 and an empty "no help" list, to the "combat list" for the space from which it attempted to move.

    unbounce, executed for a particular space
    • If there is a single unit in the "combat list" of the space which has more strength than all others, and if this unit is marked "bounce," then
      • Remove the mark of "bounce" from that unit.
      • If the unit is marked "dislodged," then remove the mark of "dislodged" from that unit.
      • Otherwise (if the unit was not marked "dislodged"), remove the unit from the "combat list" of the space where it began the turn, and execute this unbounce procedure (recursively) for that space.