[Tutor] Todays Learning Python Question From a Newbie ;)

Bob Gailer bgailer at alum.rpi.edu
Wed Feb 1 20:02:50 CET 2006


Jon Moore wrote:
> Hi,
>
> Ok its the last exercise in the chapter of the python book (Python for 
> the absolute beginner) I am working my way through.
>
> I have been learning about functions using a tic-tac-toe game as an 
> example and I understand it fairly clearly, however the author says 
> the following:
>
> Write a new computer_move() function for the tic-tac-toe game to plug 
> the hole in the computers stratergy. See if you can create an opponent 
> that is unbeatable!
>
> My main problem is that I can not see how the computers stratergy can 
> be improved as at best I can only manage a tie with the computer!
See http://ostermiller.org/tictactoeexpert.html.
The "bottom line" is "If you know what you are doing, you can't lose at 
Tic-Tac-Toe. If your opponent knows what they are doing, you can't win 
at Tic-Tac-Toe. The game is a zero sum game. If both players are playing 
with an optimal strategy, every game will end in a tie."
[snip]


More information about the Tutor mailing list