Labs

Lab 9.5: Game On!

TTT

As you saw in Lb 9.4, the TTT program only plays as well as its rule base allows it to. Given that you have complete control over the rule base (and the fact that the computer moves first in our program!), you should be able to devise a set of rules that render the program unbeatable. In building this set of rules, remember that each time TTT is restarted, or its page is re-loaded in the browser, its rule set is cleared! So, be sure to save your rule set as it evolves.

  1. Start by creating and entering rules that guarantee that the program will win if it has the chance to do so. Test the program to make sure that it plays as you expect it to.

  2. Extend your rule base so that the program will block the human from winning when it can do so.

  3. Finally, add rules to your rule base that embody any more sophisticated, strategic moves that help the program direct itself towards winning. Remember to save the final rules base as a text file.

Labs

MODULES:



© 2004 Thomson/Brooks Cole, All Rights Reserved.