Play a Perfect Game of 4x4 Hex Background

Hex is a two-player abstract strategy game played on a K&times;K rhombus of hexagonal tiles.
Two opposite sides of the rhombus are colored white, and the other two black, and the two players, black and white, take turns in placing a token of their color on an unoccupied tile.
The player who first manages to construct a path between the opposite sides of their color is the winner.
It is known that the game cannot end in a draw, and that the first player has a winning strategy regardless of the board size (see the Wikipedia page for details).

The Task

In this challenge, we fix the board size at K = 4, and represent the board as the following grid.
The thick lines denote adjacent tiles.



Your task is to produce a winning strategy for the first player, which you can choose to be either black or white.
This means that whichever legal moves the opposing player makes, your play must result in a victory.
Your input is a game position (the arrangement of tokens on the board), and your output is a legal move, in the format specified below.
If you want to find a winning strategy yourself, do not read this spoiler:


   Outline of one possible winning strategy, assuming white goes first.
 
 First select 5. After that, if you have a path from 5 to the bottom row OR black selects 0 or 1 at any point, respond by selecting whichever of 0 or 1 is vacant.
 
 If black selects 9 or 13, select 10 and then whichever of 14 or 15 is vacant. If black does not select 9, 13 or 14, then select 9 and next whichever of 13 or 14 is vacant.
 
 If black selects 14, respond by selecting 15. Next, select 10 if it is vacant; if black selects 10, respond with 11. If black then selects 6, respond with 7, and next whichever of 2 or 3 is vacant. If black does not select 6, select it, so you have a path from 5 to the bottom row.


Input and Output

Your input is a string of 16 characters WBE, which stand for white, black and empty.
They represent the tiles of the board, as enumerated above.
You can choose the input method (which also determines your output method) from the following:


Input from STDIN, output to STDOUT.
Input as one command line argument, output to STDOUT.
Input as 16 single-character command line arguments, output to STDOUT.
Input as argument of named function, output as return value.


Your output represents the tile on which you place your next token, as it is your turn to move.
You can choose from the following output formats:


A zero-based index (as used in the above picture).
A one-based index.
The input string with one E replaced by whichever of W or B you chose for your player.


Rules

Your strategy must be deterministic.
You are not required to correctly handle game positions that are unreachable from the empty board using your strategy, or positions that are already winning for either player, and you may crash on them.
Conversely, on boards that are reachable using your strategy, you must return a legal move.

This is code-golf, so the lowest byte count wins.
Standard loopholes are disallowed.

Testing

I have written a Python 3 controller for validating entries, since it would be extremely tedious to do by hand.
You can find it here.
It supports the first three input formats and Python 3 functions (functions in other languages have to be wrapped into programs), all three output formats, and both players.
If a strategy is not winning, it will output a losing game it found, so you can tweak your program.
Marbelous, 973b

This is a naive implementation of the hinted strategy in the question. It expects the board to be provided as 16 commandline/mainboard parameters like hex.mbl B W E E E W E E E B E E E E E E and it will output the zero-indexed position of white's next move.

00 }1 }0
&amp;G B? W!
&amp;0 &amp;G &amp;G
!!
00 }0 }1
&amp;H B? W!
&amp;1 &amp;H &amp;H
!!
.. }D .. }9 }9 }D }E }A }D }9 }A .. }E }F }5
}9 B! }E E? W? E? .. E? B? B? W? .. E? .. E?
B! ?0 B! &amp;M &amp;N &amp;O E? &amp;I \\ .. &amp;J .. &amp;K E? &amp;5
?0 ++ ?0 &amp;9 .. &amp;D &amp;P &amp;A &amp;I /\ &amp;J .. &amp;E &amp;L !!
++ .. ++ !! .. !! &amp;E !! \/ &amp;L /\ &amp;K !! &amp;F
\\ .. // .. .. .. !! .. .. \/ .. \/ .. !!
.. =3 \/
&amp;M /\ &amp;N
\/ &amp;O /\ &amp;P
}0 }1 }6 .. }6 .. }7 &amp;7 }2 }3 }A }A }B }E }F
..
..
..
..
..
..
..
..
..
.. .. .. .. .. .. .. .. .. .. .. .. .. B? W!
.. .. .. .. .. .. .. .. .. .. .. .. .. &amp;Q &amp;Q
.. .. .. .. B? .. E? W? E? .. E? B? E? &amp;F \/
.. .. .. &amp;S /\ &amp;T &amp;S &amp;T &amp;U E? &amp;A &amp;R &amp;R !!
.. .. .. &amp;7 .. .. \/ .. &amp;2 &amp;V !! &amp;B \/
.. .. .. !! .. .. &amp;U /\ &amp;V &amp;3 .. !!
.. .. .. .. .. .. .. .. .. !!
.. .. ..
.. .. E?
E? .. &amp;6
&amp;X E? !!
!! &amp;Y
.. !!
}4 }8 }C
\/ \/ \/
30 30 31 31 32 33 35 36 37 39 31 30 31 31 31 33 31 34 31 35
&amp;0 &amp;X &amp;1 &amp;Y &amp;2 &amp;3 &amp;5 &amp;6 &amp;7 &amp;9 &amp;A &amp;A &amp;B &amp;B &amp;D &amp;D &amp;E &amp;E &amp;F &amp;F
:W?
}0
^4
=1
{0
:B?
}0
^0
=0
{0
:E?
}0
^1
=0
{0
:W!
}0
^4
=0
{0
:B!
}0
^0
&gt;0
{0


I think I can probably golf about 200 characters out of this with better branching and elimination of code re-use.