Tic Tac Toe Game

Modification notes

There are some simple modifications you can make to change the game. The number and visual style of players is determined by $InitialRunningOrder (set as {"O","X"} for normal play. 
Whether these are human or computer players is determined by the function HumanQ. Typical settings are HumanQ["X"]=False;HumanQ["O"]=True;
Starting a new game is done with the function NewGame[size,dimensions] where size is the length of the sides of the playing area (usually 3 for the 2D game and 4 for the 3D game), and dimensions is either 2 or 3 and represents either a flat playing area or a 3 dimensional playing area. Typically if you vary these away from the two combinations supplied and use two players the result is either unwinable games or unloseable games, howver it is likely that a larger playing area may suit 3 or four player games and may result in some interesting co-operative game tactics!
The computer controlled tactics are decided by trying to maximise the function TotalScore which in turn is dependant on the function ScoreOnDimension. Both algorithms are exremely simple and I would be interested to hear from anyone who can improve on them. Unfortunately there is no multi-move look ahead or pruned search built in at the moment so you are restricted to one move look ahead. IE it considers which position will get it closer to a complete line and which positions will block nearly-complete opponent lines but it does not consider what its follow-up move will be.