As Allen (Sha Tin College) discovered,
the trick to cracking this problem is to work
systematically:
"My method was to start of with a small cube and work onwards
from that. I started off with a 3x3x3 cube and stared counting
the number of lines for each Vertical, Horizontal and Diagonal"
Doing this he discovered that there are
13 winning lines that go through middle-middle-middle.
The winning lines in general seperate into three types:
"Lines" of three cubes can be made from cubes joined face to
face
"Diagonals" are cubes joined edge to edge in a line - so the
diagonal of a face for example
"Long Diagonals"are lines of three cubes joined vertex to vertex,
going through the middle from a vertex to one diagonally
opposite.
Counting these gives 27 lines, 18 diagonals and 4 long diagonals
for the 3x3x3 cube. In general, for an n x n x n cube:
Lines:
3n^2
Diagonals: 6n
Long Diagonals: 4