Handshaking is a controversial opening strategy. A handshaker detects when it's fighting itself and causes one copy to suicide. This leaves the other copy with 100% wins and artificially inflates its score. Robert Macrae created the first handshaker in 1995. They were later explained by Kurt Franke in Core Warrior issue 20. Handshakers are cited as one of the main reasons against including self-fights on the hill.

Table-Based Handshake

A simple handshake can be added to a table-based p-switcher with two suicidal states. On the first round the handshake attempts to lose. If the warrior won despite trying to lose, it assumes it's the second warrior in a self-fight and suicides for the remaining rounds. Unfortunately this technique is vulnerable to brainwashing attacks.

        org    pthink

        pkey   equ 267

pthink  ldp.a  #0,       #1
        ldp.a  #pkey,    ptable
        add.a  pthink,   pmod
pmod    mod.a  #5,       ptable
        stp.b  *ptable,  #pkey

                              ; loss win tie
                              ;   %5  %6  %7
ptable  jmp    }0,       37   ;    2   1   2
        dat    psuicide, 176  ;    1   2   1

;       *rest of transition table*

Dedicated Handshake

In the first round a dedicated handshake normally searches for a copy of itself. If a copy is found a self-fight is assumed and a flag set. The flag causes the second copy to suicide for the remaining rounds. Brainwashing is only effective if the keys are discovered.

        org    hshake

        hkey1  equ 197
        hkey2  equ 381

;       dat    ?,        0

hshake  ldp    #0,       #0
        jmn    wgo,      @hshake
        jmz    hlost,    hshake
hseek   seq.i  hptr,     {hptr
        jmz    hseek,    hptr
hptr    stp    #-100,    #0
        mov.x  hlost,    *hptr
hlost   ldp    #hkey2,   #hkey1+1
        seq    #hkey1,   hlost
        jmp    wgo

;       dat    ?,        ?