Write the shortest game of alak
C, 617 592 bytes
#define O(x)(x-'x'?'x':'o')
q,f,t,k,i,x=4,o=4,*d;main(){char*A,Q[9],c='x',b[]=&quot;xxxx___oooo&quot;;printf(b);while(!q){scanf(&quot; %8[^\n]%*[^\n]&quot;,Q);if(!strcmp(Q,&quot;quit&quot;))break;f=*Q&gt;47&amp;&amp;*Q&lt;58?atoi(Q):-1;A=f&gt;9?Q+2:Q+1;t=*A==32&amp;&amp;A[1]&gt;47&amp;&amp;A[1]&lt;58?atoi(A+1):-1;i=t==f&amp;&amp;t&lt;0&amp;&amp;f&lt;0?1:0;for(k=f;k!=t;k+=(t-f)/abs(t-f))if(b[k]==95||b[t]-95||b[f]-c)i=1;if(i){printf(&quot;INVALID&quot;);continue;}b[t]=c;b[f]=95;for(t=0;t&lt;2;t++){d=c-'x'?&amp;o:&amp;x;for(k=1;k&lt;11;k++)if(b[k]==O(c)){for(i=k+1;b[i]==O(c)&amp;&amp;b[i];i++);if(b[i]==c&amp;&amp;b[k-1]==c)while(k&lt;i)b[k++]=95,(*d)--;}c=t?c:O(c);}printf(b);if(o&lt;2||x&lt;2)printf(&quot;P%d WINS&quot;,(x&gt;1)+1),q=1;}}

Unraveled:
#define O(x)(x-'x'?'x':'o')
q,f,t,k,i,x=4,o=4,*d;
main(){
    char*A,Q[9],c='x',b[]=&quot;xxxx___oooo&quot;;
    printf(b);
    while(!q){
        scanf(&quot; %8[^\n]%*[^\n]&quot;,Q);
        if(!strcmp(Q,&quot;quit&quot;))break;
        f=*Q&gt;47&amp;&amp;*Q&lt;58?atoi(Q):-1;
        A=f&gt;9?Q+2:Q+1;
        t=*A==32&amp;&amp;A[1]&gt;47&amp;&amp;A[1]&lt;58?atoi(A+1):-1;
        i=t==f&amp;&amp;t&lt;0&amp;&amp;f&lt;0?1:0;
        for(k=f;k!=t;k+=(t-f)/abs(t-f))
            if(b[k]==95||b[t]-95||b[f]-c)
                i=1;
        if(i){
            printf(&quot;INVALID&quot;);
            continue;
        }
        b[t]=c;
        b[f]=95;
        for(t=0;t&lt;2;t++){
            d=c-'x'?&amp;o:&amp;x;
            for(k=1;k&lt;11;k++)
                if(b[k]==O(c)){
                    for(i=k+1;b[i]==O(c)&amp;&amp;b[i];i++);
                    if(b[i]==c&amp;&amp;b[k-1]==c)
                        while(k&lt;i)b[k++]=95,(*d)--;
                }
            c=t?c:O(c);
        }
        printf(b);
        if(o&lt;2||x&lt;2)printf(&quot;P%d WINS&quot;,(x&gt;1)+1),q=1;
    }
}

I really wanted to get this one in ~400 bytes, but there are a lot of little rules here and the input processing ended up pretty obnoxious. I'm definitely not done with this. Here's a set of sample runs that covers just about everything:
xxxx___oooo0 4
_xxxx__oooo7 6
_xxxx_o_ooo4 5
_xxx_xo_ooo8 6
INVALID8 7
_xxx_xoo_oo3 4
_xx_xxoo_oo7 3
_xxo__o__oo1 4
__x_x_o__oo10 9
INVALID10 8
__x_x_o_oo_2 3
___xx_o_oo_6 5
___xxo__oo_6 6
INVALID5 5
INVALID3 6
____x_x_oo_8 7
____x_xo_o_6 8
____x__o_o_P2 WINS
 
xxxx___oooo0 4
_xxxx__oooo10 6
_xxxx_oooo_1 5
__xxxxoooo_9 1
_o____ooo__P2 WINS
 
xxxx___oooo0 4
_xxxx__oooo7 6
_xxxx_o_ooo1 5
__xxxxo_ooo10 7
__xxxxoooo_2 10
___xxx____xP1 WINS
 
xxxx___oooo3 4
xxx_x__ooooquits
INVALIDtestme
INVALID3*4
INVALID3 four
INVALIDthree four
INVALIDthisstringislongerthanmybuffer
INVALID10 0
INVALID4 5
INVALID7 6
xxx_x_o_oooquit

If I've misinterpreted something, please let me know!