In Dire Need of Ideas

Ask questions about projects relating to: computer science or pure mathematics (such as probability, statistics, geometry, etc...).

Moderators: MelissaB, kgudger, Ray Trent, Moderators

Re: In Dire Need of Ideas

Postby hhemken » Wed Jan 09, 2013 11:48 am


I suspect you are right. In getComputerMove() you have a hard-coded set of priorities in which the first of the 5 kinds of moves to be available is chosen by the AI. Most likely, the order in which you have them is a smart strategy, but the point of your project is to explore AI improvements. An obvious modification would be to create several different categories in which the order of the priorities is different. In this case you would separate out each type of move into its own function, and create some new functions that call them in different orders. These new functions would be called something like starategyA(), strategyB(), etc that would each be just like getComputerMove() except with the move choices in a different order. There would be an input parameter where the user would specify "a" for the AI to call strategyA(), "b" to call strategyB(), etc. Otherwise your program would be pretty much the same. If you can think of additional move strategies that would be good, although tic tac toe may not be complex enough to do that.

Have you thought of a checkers implementation? It would be very similar and would probably have a larger variety of move strategies.

I can't run the game because I have Python 2.7 on all my boxes. As it turns out, Python 3 adoption has been very slow because people have so much code that they would have to change to move it up to version 3. Quite a few people have commented on this, including: ... y12-02.pdf

Since your program is still small, I would suggest you re-install Python to version 2.7 and make the appropriate changes to your code so that most people will be easily able to run it. It sounds like a dumb thing to do, but that's the current state of things in Python-land.

Very good work, BTW, keep us posted!

Heinz Hemken
Heinz Hemken
Science Buddies Expert Forum
Posts: 266
Joined: Mon Oct 03, 2005 3:16 pm


Return to Grades 6-8: Math and Computer Science

Who is online

Users browsing this forum: No registered users and 1 guest